mirror of
https://github.com/home-assistant/core.git
synced 2026-09-24 07:25:52 -05:00
Add icon translations to Nmap tracker (#111983)
This commit is contained in:
@@ -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."""
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"entity": {
|
||||
"device_tracker": {
|
||||
"device_tracker": {
|
||||
"default": "mdi:lan-disconnect",
|
||||
"state": {
|
||||
"home": "mdi:lan-connect"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user