Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing problem with support preset mode #35

Merged
merged 2 commits into from
Nov 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions custom_components/dual_smart_thermostat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,15 +550,27 @@ async def async_set_hvac_mode(self, hvac_mode):
_LOGGER.info("Setting hvac mode: %s", hvac_mode)
if hvac_mode == HVACMode.HEAT:
self._hvac_mode = HVACMode.HEAT
self._support_flags = SUPPORT_TARGET_TEMPERATURE
self._support_flags = (
SUPPORT_TARGET_TEMPERATURE | SUPPORT_PRESET_MODE
if self._support_flags >= SUPPORT_PRESET_MODE
else SUPPORT_TARGET_TEMPERATURE
)
await self._async_control_heating(force=True)
elif hvac_mode == HVACMode.COOL:
self._hvac_mode = HVACMode.COOL
self._support_flags = SUPPORT_TARGET_TEMPERATURE
self._support_flags = (
SUPPORT_TARGET_TEMPERATURE | SUPPORT_PRESET_MODE
if self._support_flags >= SUPPORT_PRESET_MODE
else SUPPORT_TARGET_TEMPERATURE
)
await self._async_control_cooling(force=True)
elif hvac_mode == HVACMode.HEAT_COOL:
self._hvac_mode = HVACMode.HEAT_COOL
self._support_flags = SUPPORT_TARGET_TEMPERATURE_RANGE
self._support_flags = (
SUPPORT_TARGET_TEMPERATURE_RANGE | SUPPORT_PRESET_MODE
if self._support_flags >= SUPPORT_PRESET_MODE
else SUPPORT_TARGET_TEMPERATURE_RANGE
)
await self._async_control_heat_cool(force=True)
elif hvac_mode == HVACMode.OFF:
self._hvac_mode = HVACMode.OFF
Expand Down