Skip to content

Commit b8dc581

Browse files
committed
Improve PlugwiseCelsius class
1 parent 2bfc565 commit b8dc581

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

plugwise_usb/nodes/celsius.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,20 @@ async def load(self) -> bool:
2929
return True
3030

3131
self._node_info.is_battery_powered = True
32+
mac = self._node_info.mac
3233
if self._cache_enabled:
33-
_LOGGER.debug(
34-
"Load Celsius node %s from cache", self._node_info.mac
35-
)
34+
_LOGGER.debug("Loading Celsius node %s from cache", mac)
3635
if not await self._load_from_cache():
37-
_LOGGER.debug("Loading from cache failed")
36+
_LOGGER.debug("Loading Celsius node %s from cache failed", mac)
3837

3938
self._loaded = True
4039
self._setup_protocol(
4140
CELSIUS_FIRMWARE_SUPPORT,
4241
(NodeFeature.INFO, NodeFeature.TEMPERATURE),
4342
)
4443
if await self.initialize():
45-
await self._loaded_callback(NodeEvent.LOADED, self.mac)
44+
await self._loaded_callback(NodeEvent.LOADED, mac)
4645
return True
4746

48-
_LOGGER.debug("Load of Celsius node %s failed", self._node_info.mac)
47+
_LOGGER.debug("Loading of Celsius node %s failed", mac)
4948
return False

0 commit comments

Comments
 (0)