Add icon translations to Nmap tracker (#111983)

This commit is contained in:
Joost Lekkerkerker 2024-03-02 10:30:10 +01:00 committed by GitHub
parent c770c6c78f
commit fbb894a0ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 5 deletions

View File

@ -46,6 +46,7 @@ class NmapTrackerEntity(ScannerEntity):
"""An Nmap Tracker entity.""" """An Nmap Tracker entity."""
_attr_should_poll = False _attr_should_poll = False
_attr_translation_key = "device_tracker"
def __init__( def __init__(
self, nmap_tracker: NmapDeviceScanner, mac_address: str, active: bool self, nmap_tracker: NmapDeviceScanner, mac_address: str, active: bool
@ -98,11 +99,6 @@ class NmapTrackerEntity(ScannerEntity):
"""Return tracker source type.""" """Return tracker source type."""
return SourceType.ROUTER return SourceType.ROUTER
@property
def icon(self) -> str:
"""Return device icon."""
return "mdi:lan-connect" if self._active else "mdi:lan-disconnect"
@callback @callback
def async_process_update(self, online: bool) -> None: def async_process_update(self, online: bool) -> None:
"""Update device.""" """Update device."""

View File

@ -0,0 +1,12 @@
{
"entity": {
"device_tracker": {
"device_tracker": {
"default": "mdi:lan-disconnect",
"state": {
"home": "mdi:lan-connect"
}
}
}
}
}