File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,6 @@ async def _load_defaults(self) -> None:
167167 async def _load_from_cache (self ) -> bool :
168168 """Load states from previous cached information. Returns True if successful."""
169169 if not await super ()._load_from_cache ():
170- await self ._load_defaults ()
171170 return False
172171 self ._motion_state = MotionState (
173172 state = self ._motion_from_cache (),
Original file line number Diff line number Diff line change @@ -118,10 +118,11 @@ async def load(self) -> bool:
118118 """Load and activate SED node features."""
119119 if self ._loaded :
120120 return True
121- if self ._cache_enabled :
122- _LOGGER .debug ("Load SED node %s from cache" , self ._node_info .mac )
123- await self ._load_from_cache ()
124- else :
121+ _LOGGER .debug ("Load SED node %s from cache" , self ._node_info .mac )
122+ if await self ._load_from_cache ():
123+ self ._loaded = True
124+ if not self ._loaded :
125+ _LOGGER .debug ("Load SED node %s defaults" , self ._node_info .mac )
125126 self ._load_defaults ()
126127 self ._loaded = True
127128 self ._features += SED_FEATURES
@@ -176,7 +177,6 @@ async def _load_defaults(self) -> None:
176177 async def _load_from_cache (self ) -> bool :
177178 """Load states from previous cached information. Returns True if successful."""
178179 if not await super ()._load_from_cache ():
179- await self ._load_defaults ()
180180 return False
181181 self ._battery_config = BatteryConfig (
182182 awake_duration = self ._awake_duration_from_cache (),
You can’t perform that action at this time.
0 commit comments