Skip to content

Commit 7b8c240

Browse files
committed
Debug, rename to response
1 parent 06c4105 commit 7b8c240

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

plugwise_usb/network/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,13 @@ async def discover_network_coordinator(self, load: bool = False) -> bool:
355355

356356
# Collect network info
357357
request = StickNetworkInfoRequest(self._controller.send, None)
358-
if (network_info := await request.send()) is not None:
359-
if not isinstance(network_info, StickNetworkInfoResponse):
358+
if (response := await request.send()) is not None:
359+
if not isinstance(response, StickNetworkInfoResponse):
360360
raise MessageError(
361361
f"Invalid response message type ({response.__class__.__name__}) received, expected StickNetworkInfoResponse"
362362
)
363-
self._channel = network_info.channel
363+
self._channel = response.channel
364+
_LOGGER.debug("HOI channel: %s", self._channel)
364365

365366
if await self._discover_node(
366367
self._controller.mac_coordinator, None, ping_first=False

tests/stick_test_data.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@
3535
b"0002" # msg_id
3636
+ b"0F" # channel
3737
+ b"FFFFFFFFFFFFFFFF"
38-
+ b"060098765432101234" # 06 + plus-device mac
38+
+ b"0698765432101234" # 06 + plus-device mac
3939
+ b"FFFFFFFFFFFFFFFF"
40+
+ b"0698765432101234" # 06 + plus-device mac
41+
+ b"1606"
42+
+ b"01"
4043
),
4144
b"\x05\x05\x03\x03000AB43C\r\n": (
4245
"STICK INIT",

0 commit comments

Comments
 (0)