mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 23:27:37 +00:00
Use icon translations in devolo Home Network device tracker (#143089)
This commit is contained in:
parent
950c332e36
commit
42277955fa
@ -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."""
|
||||||
|
@ -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"
|
||||||
|
@ -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',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user