Add friendly name to Fritz profile switches (#53190)

pull/53249/head
Simone Chemelli 2021-07-20 18:38:16 +02:00 committed by GitHub
parent 193d1b945b
commit 1746103e0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 10 deletions

View File

@ -557,20 +557,14 @@ class FritzBoxDeflectionSwitch(FritzBoxBaseSwitch, SwitchEntity):
class FritzBoxProfileSwitch(FritzDeviceBase, SwitchEntity):
"""Defines a FRITZ!Box Tools DeviceProfile switch."""
_attr_icon = "mdi:router-wireless-settings"
def __init__(self, fritzbox_tools: FritzBoxTools, device: FritzDevice) -> None:
"""Init Fritz profile."""
super().__init__(fritzbox_tools, device)
self._attr_is_on: bool = False
@property
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"
self._name = f"{device.hostname} Internet Access"
self._attr_unique_id = f"{self._mac}_internet_access"
async def async_process_update(self) -> None:
"""Update device."""