Add more sensors and translations

This commit is contained in:
Andre Basche
2023-03-05 19:19:52 +01:00
parent ac9e4d211c
commit 5682149ecc
9 changed files with 111 additions and 24 deletions

View File

@ -63,9 +63,10 @@ async def async_setup_entry(hass, entry: ConfigEntry, async_add_entities) -> Non
if descriptions := SWITCHES.get(device.appliance_type_name):
for description in descriptions:
appliances.extend([
HonSwitchEntity(hass, coordinator, entry, device, description)]
)
if device.data.get(description.key) is not None or device.commands.get(description.key) is not None:
appliances.extend([
HonSwitchEntity(hass, coordinator, entry, device, description)]
)
async_add_entities(appliances)
@ -85,7 +86,6 @@ class HonSwitchEntity(HonEntity, SwitchEntity):
return self._device.settings[self.entity_description.key].typology == "fixed"
return True
@property
def is_on(self) -> bool | None:
"""Return True if entity is on."""