File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -659,9 +659,9 @@ def _get_cache_as_bool(self, setting: str) -> bool | None:
659659 """Retrieve bool of specified setting from cache memory."""
660660 if not self ._cache_enabled :
661661 return None
662- if self ._node_cache .get_state (setting ) == "True" :
663- return True
664- return False
662+ if ( bool_value := self ._node_cache .get_state (setting )) is None :
663+ return None
664+ return bool_value == "True"
665665
666666 def _get_cache_as_datetime (self , setting : str ) -> datetime | None :
667667 """Retrieve value of specified setting from cache memory and return it as datetime object."""
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ async def _load_from_cache(self) -> bool:
164164 if (sensitivity_level := self ._sensitivity_level_from_cache ()) is None :
165165 dirty = True
166166 sensitivity_level = DEFAULT_SENSITIVITY
167- dirty & = self ._motion_config_dirty_from_cache ()
167+ dirty | = self ._motion_config_dirty_from_cache ()
168168
169169 self ._motion_config = MotionConfig (
170170 daylight_mode = daylight_mode ,
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ async def _load_from_cache(self) -> bool:
161161 if (sleep_duration := self ._sleep_duration_from_cache ()) is None :
162162 dirty = True
163163 sleep_duration = SED_DEFAULT_SLEEP_DURATION
164- dirty & = self ._sed_config_dirty_from_cache ()
164+ dirty | = self ._sed_config_dirty_from_cache ()
165165 self ._battery_config = BatteryConfig (
166166 awake_duration = awake_duration ,
167167 clock_interval = clock_interval ,
@@ -331,7 +331,7 @@ async def set_sleep_duration(self, minutes: int) -> bool:
331331 # region Properties
332332 @property
333333 def dirty (self ) -> int :
334- """Battry configuration dirty flag."""
334+ """Battery configuration dirty flag."""
335335 return self ._battery_config .dirty
336336
337337 @property
You can’t perform that action at this time.
0 commit comments