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

View File

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

View File

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