mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Add icon translations to Nmap tracker (#111983)
This commit is contained in:
parent
c770c6c78f
commit
fbb894a0ff
@ -46,6 +46,7 @@ class NmapTrackerEntity(ScannerEntity):
|
||||
"""An Nmap Tracker entity."""
|
||||
|
||||
_attr_should_poll = False
|
||||
_attr_translation_key = "device_tracker"
|
||||
|
||||
def __init__(
|
||||
self, nmap_tracker: NmapDeviceScanner, mac_address: str, active: bool
|
||||
@ -98,11 +99,6 @@ class NmapTrackerEntity(ScannerEntity):
|
||||
"""Return tracker source type."""
|
||||
return SourceType.ROUTER
|
||||
|
||||
@property
|
||||
def icon(self) -> str:
|
||||
"""Return device icon."""
|
||||
return "mdi:lan-connect" if self._active else "mdi:lan-disconnect"
|
||||
|
||||
@callback
|
||||
def async_process_update(self, online: bool) -> None:
|
||||
"""Update device."""
|
||||
|
12
homeassistant/components/nmap_tracker/icons.json
Normal file
12
homeassistant/components/nmap_tracker/icons.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"entity": {
|
||||
"device_tracker": {
|
||||
"device_tracker": {
|
||||
"default": "mdi:lan-disconnect",
|
||||
"state": {
|
||||
"home": "mdi:lan-connect"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user