Correct window bypass (#899)
This commit is contained in:
@@ -453,22 +453,23 @@ 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:
|
|
||||||
_LOGGER.info(
|
if self._window_state == STATE_ON:
|
||||||
"%s - Last window state was open & ByPass is now off. Set hvac_mode to '%s'",
|
if not self._is_window_bypass:
|
||||||
self,
|
_LOGGER.info(
|
||||||
HVACMode.OFF,
|
"%s - Last window state was open & ByPass is now off. Set hvac_mode to '%s'",
|
||||||
)
|
self,
|
||||||
self._vtherm.save_hvac_mode()
|
HVACMode.OFF,
|
||||||
await self._vtherm.async_set_hvac_mode(HVACMode.OFF)
|
)
|
||||||
return True
|
self._vtherm.save_hvac_mode()
|
||||||
|
await self._vtherm.async_set_hvac_mode(HVACMode.OFF)
|
||||||
|
|
||||||
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,
|
||||||
)
|
)
|
||||||
await self._vtherm.restore_hvac_mode(True)
|
await self._vtherm.restore_hvac_mode(True)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user