From fde0b9a8b297b81c48377803525322cc2cfc03f7 Mon Sep 17 00:00:00 2001 From: basbruss <4a3.brussee.bas@gmail.com> Date: Wed, 8 May 2024 22:08:47 +0200 Subject: [PATCH] Fix switch status after (re)setup --- custom_components/adaptive_cover/coordinator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/adaptive_cover/coordinator.py b/custom_components/adaptive_cover/coordinator.py index 394a393..18450e6 100644 --- a/custom_components/adaptive_cover/coordinator.py +++ b/custom_components/adaptive_cover/coordinator.py @@ -97,9 +97,9 @@ def __init__(self, hass: HomeAssistant) -> None: # noqa: D107 self._climate_mode = self.config_entry.options.get(CONF_CLIMATE_MODE, False) self._switch_mode = True if self._climate_mode else False self._inverse_state = self.config_entry.options.get(CONF_INVERSE_STATE, False) - self._temp_toggle = False - self._control_toggle = True - self._manual_toggle = True + self._temp_toggle = None + self._control_toggle = None + self._manual_toggle = None self.manual_reset = self.config_entry.options.get( CONF_MANUAL_OVERRIDE_RESET, False ) @@ -206,7 +206,7 @@ async def _async_update_data(self) -> AdaptiveCoverData: self.default_state = round(NormalCoverState(cover_data).get_state()) - if self.cover_state_change and self._manual_toggle and self.control_toggle: + if self.cover_state_change and self.manual_toggle and self.control_toggle: self.manager.handle_state_change( self.state_change_data, self.state,