Refactor hon entities

This commit is contained in:
Andre Basche
2023-05-28 00:30:08 +02:00
parent 696dc136eb
commit a8762367ed
8 changed files with 382 additions and 369 deletions
+1 -5
View File
@@ -53,11 +53,7 @@ async def async_setup_entry(hass, entry: ConfigEntry, async_add_entities) -> Non
class HonButtonEntity(HonEntity, ButtonEntity):
def __init__(self, hass, entry, device: HonAppliance, description) -> None:
super().__init__(hass, entry, device)
self.entity_description = description
self._attr_unique_id = f"{super().unique_id}{description.key}"
entity_description: ButtonEntityDescription
async def async_press(self) -> None:
await self._device.commands[self.entity_description.key].send()