Files
oott/frontend/lib/model/device_event.dart
T
rzuastiandClaude Opus 4.8 440959b10d Add SSDP/UPnP scanner to frontend status displays
Surface the SSDP/UPnP scanner alongside ARP and mDNS: a dedicated card on
the Status screen and a row in the consolidated Status card on Home. Mirrors
the existing mDNS implementation and reuses the generic ScannerStatusCard and
PolledValue infrastructure. Also maps the 'Ssdp' device-event scanner to the
"SSDP/UPnP" label.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 18:13:33 -04:00

39 lines
975 B
Dart

class DeviceEvent {
final int id;
final String macAddress;
final DateTime createdOn;
final String eventType;
final String ipv4Address;
final String vendor;
final String scanner;
const DeviceEvent({
required this.id,
required this.macAddress,
required this.createdOn,
required this.eventType,
required this.ipv4Address,
required this.vendor,
required this.scanner,
});
factory DeviceEvent.fromJson(Map<String, dynamic> json) {
return DeviceEvent(
id: json['id'] as int,
macAddress: json['mac_address'] as String,
createdOn: DateTime.parse(json['created_on'] as String),
eventType: json['event_type'] as String,
ipv4Address: json['ipv4_address'] as String,
vendor: json['vendor'] as String,
scanner: json['scanner'] as String,
);
}
String get scannerLabel => switch (scanner) {
'Arp' => 'ARP',
'Mdns' => 'mDNS',
'Ssdp' => 'SSDP/UPnP',
_ => scanner,
};
}