From 0f9f0dee4ccf3dac9c3700c62e38e40816b8b27d Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Thu, 8 Jun 2023 21:46:36 +0200 Subject: [PATCH] Fix issues when changing climate mode #52 --- custom_components/hon/climate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/custom_components/hon/climate.py b/custom_components/hon/climate.py index c0166de..5c5fa2a 100644 --- a/custom_components/hon/climate.py +++ b/custom_components/hon/climate.py @@ -150,11 +150,13 @@ class HonACClimateEntity(HonEntity, ClimateEntity): async def async_set_hvac_mode(self, hvac_mode): self._attr_hvac_mode = hvac_mode if hvac_mode == HVACMode.OFF: - await self._device.commands["stopProgram"].send() + command = "stopProgram" else: mode = HON_HVAC_PROGRAM[hvac_mode] self._device.settings["startProgram.program"].value = mode - await self._device.commands["startProgram"].send() + command = "startProgram" + await self._device.commands[command].send() + self._device.sync_command(command, "settings") self.async_write_ha_state() @property