File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed
Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -190,9 +190,6 @@ def _clock_interval_from_cache(self) -> int | None:
190190
191191 def _clock_sync_from_cache (self ) -> bool | None :
192192 """Load clock sync state from cache."""
193- _LOGGER .debug (
194- "MDI: Bool: %s" , str (self ._get_cache_as_bool (CACHE_SED_CLOCK_SYNC ))
195- )
196193 return self ._get_cache_as_bool (CACHE_SED_CLOCK_SYNC )
197194
198195 def _maintenance_interval_from_cache (self ) -> int | None :
Original file line number Diff line number Diff line change @@ -2417,6 +2417,33 @@ async def test_node_discovery_and_load( # noqa: PLR0915
24172417 self , monkeypatch : pytest .MonkeyPatch
24182418 ) -> None :
24192419 """Testing discovery of nodes."""
2420+
2421+ def fake_cache (dummy : object , setting : str ) -> str | None : # noqa: PLR0911
2422+ """Fake cache retrieval."""
2423+ if setting == pw_node .CACHE_FIRMWARE :
2424+ return "2011-5-13-7-26-54"
2425+ if setting == pw_node .CACHE_HARDWARE :
2426+ return "080029"
2427+ if setting == pw_node .CACHE_NODE_INFO_TIMESTAMP :
2428+ return "2024-12-7-1-0-0"
2429+ if setting == pw_node .CACHE_RELAY :
2430+ return "True"
2431+ if setting == pw_sed .CACHE_SED_AWAKE_DURATION :
2432+ return "10"
2433+ if setting == pw_sed .CACHE_SED_CLOCK_INTERVAL :
2434+ return "25200"
2435+ if setting == pw_sed .CACHE_SED_CLOCK_SYNC :
2436+ return False
2437+ if setting == pw_sed .CACHE_SED_MAINTENANCE_INTERVAL :
2438+ return "60"
2439+ if setting == pw_sed .CACHE_SED_SLEEP_DURATION :
2440+ return "60"
2441+ if setting == pw_sed .CACHE_SED_DIRTY :
2442+ return False
2443+ return None
2444+
2445+ monkeypatch .setattr (pw_node .PlugwiseBaseNode , "_get_cache" , fake_cache )
2446+ monkeypatch .setattr (pw_node .PlugwiseBaseNode , "_get_cache_as_bool" , fake_cache )
24202447 mock_serial = MockSerial (None )
24212448 monkeypatch .setattr (
24222449 pw_connection_manager ,
You can’t perform that action at this time.
0 commit comments