diff --git a/plugwise_usb/nodes/circle_plus.py b/plugwise_usb/nodes/circle_plus.py index d89603a67..66a52fcdb 100644 --- a/plugwise_usb/nodes/circle_plus.py +++ b/plugwise_usb/nodes/circle_plus.py @@ -38,38 +38,26 @@ async def load(self) -> bool: if self._loaded: return True if self._cache_enabled: - _LOGGER.debug("Loading Circle node %s from cache", self._node_info.mac) + _LOGGER.debug("Loading Circle+ node %s from cache", self._mac_in_str) if await self._load_from_cache(): self._loaded = True - self._setup_protocol(CIRCLE_PLUS_FIRMWARE_SUPPORT, FEATURES_CIRCLE_PLUS) - if await self.initialize(): - await self._loaded_callback(NodeEvent.LOADED, self.mac) - return True - - _LOGGER.info( - "Loading Circle+ node %s from cache failed", - self._node_info.mac, - ) - else: - _LOGGER.debug("Loading Circle+ node %s", self._node_info.mac) - - # Check if node is online - if not self._available and not await self.is_online(): - _LOGGER.warning( - "Failed to load Circle+ node %s because it is not online", - self._node_info.mac, - ) - return False - - # Get node info - if await self.node_info_update() is None: - _LOGGER.warning( - "Failed to load Circle+ node %s because it is not responding to information request", - self._node_info.mac, - ) - return False + if not self._loaded: + _LOGGER.debug("Retrieving info for Circle+ node %s", self._mac_in_str) + + # Check if node is online + if ( + not self._available + and not await self.is_online() + or await self.node_info_update() is None + ): + _LOGGER.warning( + "Failed to load Circle+ node %s because it is not online or not responding", + self._mac_in_str, + ) + return False self._loaded = True + self._setup_protocol(CIRCLE_PLUS_FIRMWARE_SUPPORT, FEATURES_CIRCLE_PLUS) if not await self.initialize(): return False