mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Add mDNS scanner status to Status and Home screens
Add an mDNS Scanner status card to the Status screen mirroring the ARP card, and replace the ARP card on the Home screen with a combined Status card that summarizes both scanners in one line each. Extract the shared duration formatting helper into utils/duration_formatter.dart. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
c6fdf9e181
commit
75f597bfe4
@@ -0,0 +1,23 @@
|
||||
class MdnsScannerStatus {
|
||||
final bool isListening;
|
||||
final double? listeningForSeconds;
|
||||
final int devicesSeen;
|
||||
final double? lastDeviceSeenSecondsAgo;
|
||||
|
||||
const MdnsScannerStatus({
|
||||
required this.isListening,
|
||||
this.listeningForSeconds,
|
||||
required this.devicesSeen,
|
||||
this.lastDeviceSeenSecondsAgo,
|
||||
});
|
||||
|
||||
factory MdnsScannerStatus.fromJson(Map<String, dynamic> json) {
|
||||
return MdnsScannerStatus(
|
||||
isListening: json['is_listening'] as bool,
|
||||
listeningForSeconds: (json['listening_for_seconds'] as num?)?.toDouble(),
|
||||
devicesSeen: (json['devices_seen'] as num).toInt(),
|
||||
lastDeviceSeenSecondsAgo: (json['last_device_seen_seconds_ago'] as num?)
|
||||
?.toDouble(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user