Skip to content

Commit

Permalink
Fix cancel boost mode when change preset
Browse files Browse the repository at this point in the history
  • Loading branch information
cyr-ius committed Nov 19, 2023
1 parent 8525564 commit 1ecb56c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions custom_components/heatzy/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import logging
from typing import Any

from heatzypy.exception import HeatzyException
import voluptuous as vol

from heatzypy.exception import HeatzyException
from homeassistant.components.climate import (
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW,
Expand All @@ -23,7 +22,8 @@
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_DELAY, UnitOfTemperature
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import config_validation as cv, entity_platform
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers import entity_platform
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
Expand Down Expand Up @@ -336,13 +336,13 @@ async def async_turn_auto(self) -> None:
async def async_set_preset_mode(self, preset_mode: str) -> None:
"""Set new preset mode."""
if preset_mode == PRESET_BOOST:
return self.async_boost_mode(60)
return await self.async_boost_mode(60)

config: dict[str, Any] = {
CONF_ATTRS: {CONF_MODE: self.HA_TO_HEATZY_STATE.get(preset_mode)}
}
# If in VACATION mode then as well as setting preset mode we also stop the VACATION mode
if self._attr.get(CONF_DEROG_MODE) == 1:
if self._attr.get(CONF_DEROG_MODE) > 0:
config[CONF_ATTRS].update({CONF_DEROG_MODE: 0, CONF_DEROG_TIME: 0})
try:
await self.coordinator.api.async_control_device(self.unique_id, config)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/heatzy/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"issue_tracker": "https://github.com/cyr-ius/hass-heatzy/issues",
"loggers": ["heatzypy"],
"requirements": ["heatzypy==2.1.5"],
"version": "5.9.7-beta0"
"version": "5.9.7-beta1"
}

0 comments on commit 1ecb56c

Please sign in to comment.