2026-06-05 21:57:58 -04:00
|
|
|
/// Status of a passive scanner (one that listens continuously, e.g. mDNS, SSDP,
|
|
|
|
|
/// DHCP). Mirrors the backend's `PassiveSnapshot` / `PassiveScannerStatusResponse`.
|
|
|
|
|
class PassiveScannerStatus {
|
2026-06-01 18:13:33 -04:00
|
|
|
final bool isListening;
|
|
|
|
|
final double? listeningForSeconds;
|
|
|
|
|
final int devicesSeen;
|
|
|
|
|
final double? lastDeviceSeenSecondsAgo;
|
|
|
|
|
|
2026-06-05 21:57:58 -04:00
|
|
|
const PassiveScannerStatus({
|
2026-06-01 18:13:33 -04:00
|
|
|
required this.isListening,
|
|
|
|
|
this.listeningForSeconds,
|
|
|
|
|
required this.devicesSeen,
|
|
|
|
|
this.lastDeviceSeenSecondsAgo,
|
|
|
|
|
});
|
|
|
|
|
|
2026-06-05 21:57:58 -04:00
|
|
|
factory PassiveScannerStatus.fromJson(Map<String, dynamic> json) {
|
|
|
|
|
return PassiveScannerStatus(
|
2026-06-01 18:13:33 -04:00
|
|
|
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(),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|