Skip to content

Commit c30609f

Browse files
committed
register_node(): update to StickResponseType
No NodeResponseType returning for NodeAddRequest
1 parent cbcec71 commit c30609f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugwise_usb/network/registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
NodeRemoveRequest,
1818
PlugwiseRequest,
1919
)
20-
from ..messages.responses import NodeResponseType, PlugwiseResponse
20+
from ..messages.responses import PlugwiseResponse, StickResponseType
2121
from .cache import NetworkRegistrationCache
2222

2323
_LOGGER = logging.getLogger(__name__)
@@ -250,7 +250,7 @@ async def register_node(self, mac: str) -> int:
250250

251251
request = NodeAddRequest(self._send_to_controller, bytes(mac, UTF8), True)
252252
response = await request.send()
253-
if response is None or response.ack_id != NodeResponseType.JOIN_ACCEPTED:
253+
if response is None or response.ack_id != StickResponseType.ACCEPT:
254254
raise NodeError(f"Failed to register node {mac}")
255255
self.update_network_registration(self._first_free_address, mac, None)
256256
self._first_free_address += 1

0 commit comments

Comments
 (0)