Skip to content

Commit

Permalink
Issue #903 - Modify "follow underlying changes" behavior - Transform …
Browse files Browse the repository at this point in the history
…'Auto' hvac_mode to 'Heating'
  • Loading branch information
Jean-Marc Collin committed Feb 10, 2025
1 parent ea0d66f commit d4a719a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ def post_init(self, entry_infos: ConfigData):
async def start_listening(self):
"""Start listening the underlying entity"""

#Try to get last window bypass state
# Try to get last window bypass state
old_state = await self._vtherm.async_get_last_state()
self._is_window_bypass = True if old_state and old_state.attributes and old_state.attributes.get("is_window_bypass") == True else False
self._is_window_bypass = True if old_state and old_state.attributes and old_state.attributes.get("is_window_bypass") is True else False

if self._is_configured:
self.stop_listening()
if self._window_sensor_entity_id:
Expand Down Expand Up @@ -453,7 +453,7 @@ async def set_window_bypass(self, window_bypass: bool) -> bool:
"""Set the window bypass flag
Return True if state have been changed"""
self._is_window_bypass = window_bypass

if self._window_state == STATE_ON:
if not self._is_window_bypass:
_LOGGER.info(
Expand Down
4 changes: 4 additions & 0 deletions custom_components/versatile_thermostat/thermostat_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,10 @@ async def end_climate_changed(changes: bool):
changes = False
new_hvac_mode = new_state.state

# Issue #903 - patch AUTO mode
if new_hvac_mode == HVACMode.AUTO:
new_hvac_mode = HVACMode.HEAT if not self.ac_mode else HVACMode.COOL

old_state = event.data.get("old_state")

# Issue #829 - refresh underlying command if it comes back to life
Expand Down

0 comments on commit d4a719a

Please sign in to comment.