3434 NodeImageValidationResponse ,
3535 NodeInfoResponse ,
3636 NodePingResponse ,
37+ NodeRejoinResponse ,
3738 NodeRemoveResponse ,
3839 NodeResponse ,
3940 NodeSpecificResponse ,
@@ -107,9 +108,6 @@ def __init__(
107108 self ._response_future : Future [PlugwiseResponse ] = self ._loop .create_future ()
108109 self ._waiting_for_response = False
109110
110- self .no_stick_response = False
111-
112-
113111 def __repr__ (self ) -> str :
114112 """Convert request into writable str."""
115113 if self ._seq_id is None :
@@ -409,8 +407,6 @@ def serialize(self) -> bytes:
409407class NodeAddRequest (PlugwiseRequest ):
410408 """Add node to the Plugwise Network and add it to memory of Circle+ node.
411409
412- The Stick does not respond with ACCEPT to this request (@bouwew)
413-
414410 Supported protocols : 1.0, 2.0
415411 Response message : NodeRejoinResponse, b"0061" (@bouwew)
416412 """
@@ -430,11 +426,19 @@ def __init__(
430426 self ._args .append (Int (accept_value , length = 2 ))
431427
432428 self .max_retries = 1 # No retrying, will delay the NodeRejoinResponse
433- self .no_stick_response = True
434429
435- async def send (self ) -> None :
430+ async def send (self ) -> NodeRejoinResponse | None :
436431 """Send request."""
437- await self ._send_request ()
432+ result = await self ._send_request ()
433+ if isinstance (result , NodeRejoinResponse ):
434+ return result
435+
436+ if result is None :
437+ return None
438+
439+ raise MessageError (
440+ f"Invalid response message. Received { result .__class__ .__name__ } , expected NodeRejoinResponse"
441+ )
438442
439443 # This message has an exceptional format (MAC at end of message)
440444 # and therefore a need to override the serialize method
0 commit comments