Skip to content

Commit 726dcdd

Browse files
committed
Let SED->load() return None
1 parent 2af5d3e commit 726dcdd

File tree

5 files changed

+5
-12
lines changed

5 files changed

+5
-12
lines changed

plugwise_usb/nodes/scan.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,7 @@ async def load(self) -> bool:
108108
return True
109109

110110
_LOGGER.debug("Loading Scan node %s", self._node_info.mac)
111-
if not await super().load():
112-
_LOGGER.warning("Load Scan base node failed")
113-
return False
111+
await super().load()
114112

115113
self._setup_protocol(SCAN_FIRMWARE_SUPPORT, SCAN_FEATURES)
116114
if await self.initialize():

plugwise_usb/nodes/sed.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def __init__(
114114
self._maintenance_last_awake: datetime | None = None
115115
self._maintenance_interval_restored_from_cache = False
116116

117-
async def load(self) -> bool:
117+
async def load(self) -> None:
118118
"""Load and activate SED node features."""
119119
if self._loaded:
120120
return True
@@ -126,7 +126,6 @@ async def load(self) -> bool:
126126
self._load_defaults()
127127
self._loaded = True
128128
self._features += SED_FEATURES
129-
return True
130129

131130
async def unload(self) -> None:
132131
"""Deactivate and unload node features."""

plugwise_usb/nodes/sense.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ async def load(self) -> bool:
5959
return True
6060

6161
_LOGGER.debug("Loading Sense node %s", self._node_info.mac)
62-
if not await super().load():
63-
_LOGGER.warning("Load Sense base node failed")
64-
return False
62+
await super().load()
6563

6664
self._setup_protocol(SENSE_FIRMWARE_SUPPORT, SENSE_FEATURES)
6765
if await self.initialize():

plugwise_usb/nodes/switch.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ async def load(self) -> bool:
5252
return True
5353

5454
_LOGGER.debug("Loading Switch node %s", self._node_info.mac)
55-
if not await super().load():
56-
_LOGGER.warning("Load Switch base node failed")
57-
return False
55+
await super().load()
5856

5957
self._setup_protocol(SWITCH_FIRMWARE_SUPPORT, SWITCH_FEATURES)
6058
if await self.initialize():

tests/test_usb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1951,7 +1951,7 @@ async def load_callback(event: pw_api.NodeEvent, mac: str) -> None: # type: ign
19511951

19521952
assert test_sed.node_info.is_battery_powered
19531953
assert test_sed.is_battery_powered
1954-
assert await test_sed.load()
1954+
assert await test_sed.load() is None
19551955
assert sorted(test_sed.features) == sorted(
19561956
(
19571957
pw_api.NodeFeature.AVAILABLE,

0 commit comments

Comments
 (0)