Skip to content

Commit

Permalink
Honeywell Correct key name (#87018)
Browse files Browse the repository at this point in the history
* Correct key name

* Logic error around setpoint and auto mode

* Set tempurature and setpoints correctly

* Only high/low in auto.
  • Loading branch information
mkmer authored Jan 31, 2023
1 parent 52cf6c7 commit ee30f5a
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions homeassistant/components/honeywell/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@ async def _set_temperature(self, **kwargs) -> None:
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:
Expand All @@ -299,15 +299,10 @@ async def _set_temperature(self, **kwargs) -> None:
)

# 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)
Expand All @@ -316,6 +311,14 @@ async def async_set_temperature(self, **kwargs: Any) -> None:
"""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."""
Expand Down

0 comments on commit ee30f5a

Please sign in to comment.