@@ -38,38 +38,26 @@ async def load(self) -> bool:
3838 if self ._loaded :
3939 return True
4040 if self ._cache_enabled :
41- _LOGGER .debug ("Loading Circle node %s from cache" , self ._node_info . mac )
41+ _LOGGER .debug ("Loading Circle+ node %s from cache" , self ._mac_in_str )
4242 if await self ._load_from_cache ():
4343 self ._loaded = True
44- self ._setup_protocol (CIRCLE_PLUS_FIRMWARE_SUPPORT , FEATURES_CIRCLE_PLUS )
45- if await self .initialize ():
46- await self ._loaded_callback (NodeEvent .LOADED , self .mac )
47- return True
48-
49- _LOGGER .info (
50- "Loading Circle+ node %s from cache failed" ,
51- self ._node_info .mac ,
52- )
53- else :
54- _LOGGER .debug ("Loading Circle+ node %s" , self ._node_info .mac )
55-
56- # Check if node is online
57- if not self ._available and not await self .is_online ():
58- _LOGGER .warning (
59- "Failed to load Circle+ node %s because it is not online" ,
60- self ._node_info .mac ,
61- )
62- return False
63-
64- # Get node info
65- if await self .node_info_update () is None :
66- _LOGGER .warning (
67- "Failed to load Circle+ node %s because it is not responding to information request" ,
68- self ._node_info .mac ,
69- )
70- return False
44+ if not self ._loaded :
45+ _LOGGER .debug ("Retrieving info for Circle+ node %s" , self ._mac_in_str )
46+
47+ # Check if node is online
48+ if (
49+ not self ._available
50+ and not await self .is_online ()
51+ or await self .node_info_update () is None
52+ ):
53+ _LOGGER .warning (
54+ "Failed to load Circle+ node %s because it is not online or not responding" ,
55+ self ._mac_in_str ,
56+ )
57+ return False
7158
7259 self ._loaded = True
60+
7361 self ._setup_protocol (CIRCLE_PLUS_FIRMWARE_SUPPORT , FEATURES_CIRCLE_PLUS )
7462 if not await self .initialize ():
7563 return False
0 commit comments