Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ollo69 authored and swingerman committed Nov 13, 2022
1 parent 8d5fe53 commit 783b53d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/dual_smart_thermostat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ def _async_startup(*_):
hvac_mode = HVACMode.OFF
self._set_default_target_temps()

# restore previous preset mode if available
old_pres_mode = old_state.attributes.get(ATTR_PRESET_MODE)
if self.preset_modes and old_pres_mode in self._presets:
self._preset_mode = old_pres_mode
Expand All @@ -424,6 +425,7 @@ def _async_startup(*_):
# No previous state, try and restore defaults
if not self._hvac_mode:
self._hvac_mode = HVACMode.OFF
if self._hvac_mode == HVACMode.OFF:
self._set_default_target_temps()

# Set correct support flag
Expand Down

0 comments on commit 783b53d

Please sign in to comment.