From 1caca9117475b4cc69c59947cb5316850c49cace Mon Sep 17 00:00:00 2001 From: mkmer Date: Tue, 31 Jan 2023 12:59:06 -0500 Subject: [PATCH] Honeywell Correct key name (#87018) * Correct key name * Logic error around setpoint and auto mode * Set tempurature and setpoints correctly * Only high/low in auto. --- homeassistant/components/honeywell/climate.py | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/honeywell/climate.py b/homeassistant/components/honeywell/climate.py index 4a773201171..0267eb32e47 100644 --- a/homeassistant/components/honeywell/climate.py +++ b/homeassistant/components/honeywell/climate.py @@ -274,10 +274,10 @@ class HoneywellUSThermostat(ClimateEntity): if self._device.hold_heat is False and self._device.hold_cool is False: # Get next period time hour_heat, minute_heat = divmod( - self._device.raw_ui_data["HEATNextPeriod"] * 15, 60 + self._device.raw_ui_data["HeatNextPeriod"] * 15, 60 ) hour_cool, minute_cool = divmod( - self._device.raw_ui_data["COOLNextPeriod"] * 15, 60 + self._device.raw_ui_data["CoolNextPeriod"] * 15, 60 ) # Set hold time if mode in COOLING_MODES: @@ -290,15 +290,10 @@ class HoneywellUSThermostat(ClimateEntity): ) # Set temperature if not in auto - elif mode == "cool": + if mode == "cool": await self._device.set_setpoint_cool(temperature) - elif mode == "heat": + if mode == "heat": await self._device.set_setpoint_heat(temperature) - elif mode == "auto": - if temperature := kwargs.get(ATTR_TARGET_TEMP_HIGH): - await self._device.set_setpoint_cool(temperature) - if temperature := kwargs.get(ATTR_TARGET_TEMP_LOW): - await self._device.set_setpoint_heat(temperature) except AIOSomecomfort.SomeComfortError as err: _LOGGER.error("Invalid temperature %.1f: %s", temperature, err) @@ -307,6 +302,14 @@ class HoneywellUSThermostat(ClimateEntity): """Set new target temperature.""" if {HVACMode.COOL, HVACMode.HEAT} & set(self._hvac_mode_map): await self._set_temperature(**kwargs) + try: + if temperature := kwargs.get(ATTR_TARGET_TEMP_HIGH): + await self._device.set_setpoint_cool(temperature) + if temperature := kwargs.get(ATTR_TARGET_TEMP_LOW): + await self._device.set_setpoint_heat(temperature) + + except AIOSomecomfort.SomeComfortError as err: + _LOGGER.error("Invalid temperature %.1f: %s", temperature, err) async def async_set_fan_mode(self, fan_mode: str) -> None: """Set new target fan mode."""