Correct window bypass (#899)

This commit is contained in:
adi90x
2025-02-10 17:44:28 +01:00
committed by GitHub
parent 1576e9c189
commit 641801084d

View File

@@ -453,7 +453,9 @@ class FeatureWindowManager(BaseFeatureManager):
"""Set the window bypass flag """Set the window bypass flag
Return True if state have been changed""" Return True if state have been changed"""
self._is_window_bypass = window_bypass self._is_window_bypass = window_bypass
if not self._is_window_bypass and self._window_state:
if self._window_state == STATE_ON:
if not self._is_window_bypass:
_LOGGER.info( _LOGGER.info(
"%s - Last window state was open & ByPass is now off. Set hvac_mode to '%s'", "%s - Last window state was open & ByPass is now off. Set hvac_mode to '%s'",
self, self,
@@ -461,9 +463,8 @@ class FeatureWindowManager(BaseFeatureManager):
) )
self._vtherm.save_hvac_mode() self._vtherm.save_hvac_mode()
await self._vtherm.async_set_hvac_mode(HVACMode.OFF) await self._vtherm.async_set_hvac_mode(HVACMode.OFF)
return True
if self._is_window_bypass and self._window_state: if self._is_window_bypass:
_LOGGER.info( _LOGGER.info(
"%s - Last window state was open & ByPass is now on. Set hvac_mode to last available mode", "%s - Last window state was open & ByPass is now on. Set hvac_mode to last available mode",
self, self,