Split program and mach mode of ac #75

This commit is contained in:
Andre Basche 2023-06-21 19:52:32 +02:00
parent 78727e89cd
commit fbd1bdf5ba
23 changed files with 508 additions and 31 deletions

View file

@ -201,8 +201,6 @@ class HonConfigSelectEntity(HonEntity, SelectEntity):
async def async_select_option(self, option: str) -> None:
setting = self._device.settings[self.entity_description.key]
setting.value = self._option_to_number(option, setting.values)
command = self.entity_description.key.split(".")[0]
await self._device.commands[command].send()
await self.coordinator.async_refresh()
@callback
@ -224,6 +222,10 @@ class HonSelectEntity(HonConfigSelectEntity):
async def async_select_option(self, option: str) -> None:
setting = self._device.settings[self.entity_description.key]
setting.value = self._option_to_number(option, setting.values)
command = self.entity_description.key.split(".")[0]
await self._device.commands[command].send()
if command != "settings":
self._device.sync_command(command, "settings")
await self.coordinator.async_refresh()
@property