Use icon translations in devolo Home Network device tracker (#143089)

This commit is contained in:
Guido Schmitz 2025-04-16 15:38:26 +02:00 committed by GitHub
parent 950c332e36
commit 42277955fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 8 deletions

View File

@ -88,6 +88,8 @@ class DevoloScannerEntity( # pylint: disable=hass-enforce-class-module
):
"""Representation of a devolo device tracker."""
_attr_translation_key = "device_tracker"
def __init__(
self,
coordinator: DevoloDataUpdateCoordinator[list[ConnectedStationInfo]],
@ -123,13 +125,6 @@ class DevoloScannerEntity( # pylint: disable=hass-enforce-class-module
)
return attrs
@property
def icon(self) -> str:
"""Return device icon."""
if self.is_connected:
return "mdi:lan-connect"
return "mdi:lan-disconnect"
@property
def is_connected(self) -> bool:
"""Return true if the device is connected to the network."""

View File

@ -13,6 +13,14 @@
"default": "mdi:wifi-plus"
}
},
"device_tracker": {
"device_tracker": {
"default": "mdi:lan-disconnect",
"state": {
"home": "mdi:lan-connect"
}
}
},
"sensor": {
"connected_plc_devices": {
"default": "mdi:lan"

View File

@ -3,7 +3,6 @@
StateSnapshot({
'attributes': ReadOnlyDict({
'band': '5 GHz',
'icon': 'mdi:lan-connect',
'mac': 'AA:BB:CC:DD:EE:FF',
'source_type': <SourceType.ROUTER: 'router'>,
'wifi': 'Main',