Add friendly name to Fritz profile switches (#53190)
parent
193d1b945b
commit
1746103e0e
|
@ -557,20 +557,14 @@ class FritzBoxDeflectionSwitch(FritzBoxBaseSwitch, SwitchEntity):
|
||||||
class FritzBoxProfileSwitch(FritzDeviceBase, SwitchEntity):
|
class FritzBoxProfileSwitch(FritzDeviceBase, SwitchEntity):
|
||||||
"""Defines a FRITZ!Box Tools DeviceProfile switch."""
|
"""Defines a FRITZ!Box Tools DeviceProfile switch."""
|
||||||
|
|
||||||
|
_attr_icon = "mdi:router-wireless-settings"
|
||||||
|
|
||||||
def __init__(self, fritzbox_tools: FritzBoxTools, device: FritzDevice) -> None:
|
def __init__(self, fritzbox_tools: FritzBoxTools, device: FritzDevice) -> None:
|
||||||
"""Init Fritz profile."""
|
"""Init Fritz profile."""
|
||||||
super().__init__(fritzbox_tools, device)
|
super().__init__(fritzbox_tools, device)
|
||||||
self._attr_is_on: bool = False
|
self._attr_is_on: bool = False
|
||||||
|
self._name = f"{device.hostname} Internet Access"
|
||||||
@property
|
self._attr_unique_id = f"{self._mac}_internet_access"
|
||||||
def unique_id(self) -> str:
|
|
||||||
"""Return device unique id."""
|
|
||||||
return f"{self._mac}_switch"
|
|
||||||
|
|
||||||
@property
|
|
||||||
def icon(self) -> str:
|
|
||||||
"""Return device icon."""
|
|
||||||
return "mdi:router-wireless-settings"
|
|
||||||
|
|
||||||
async def async_process_update(self) -> None:
|
async def async_process_update(self) -> None:
|
||||||
"""Update device."""
|
"""Update device."""
|
||||||
|
|
Loading…
Reference in New Issue