Save & Recover Window Bypass state (#898)
* Remove windows_bypass state from unrecorded * Recover bypass_state
This commit is contained in:
@@ -44,7 +44,6 @@ class FeatureWindowManager(BaseFeatureManager):
|
|||||||
{
|
{
|
||||||
"window_sensor_entity_id",
|
"window_sensor_entity_id",
|
||||||
"is_window_configured",
|
"is_window_configured",
|
||||||
"is_window_bypass",
|
|
||||||
"window_delay_sec",
|
"window_delay_sec",
|
||||||
"window_off_delay_sec",
|
"window_off_delay_sec",
|
||||||
"window_auto_configured",
|
"window_auto_configured",
|
||||||
@@ -130,6 +129,11 @@ class FeatureWindowManager(BaseFeatureManager):
|
|||||||
@overrides
|
@overrides
|
||||||
async def start_listening(self):
|
async def start_listening(self):
|
||||||
"""Start listening the underlying entity"""
|
"""Start listening the underlying entity"""
|
||||||
|
|
||||||
|
#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
|
||||||
|
|
||||||
if self._is_configured:
|
if self._is_configured:
|
||||||
self.stop_listening()
|
self.stop_listening()
|
||||||
if self._window_sensor_entity_id:
|
if self._window_sensor_entity_id:
|
||||||
|
|||||||
Reference in New Issue
Block a user