@@ -409,26 +409,11 @@ def serialize(self) -> bytes:
409409 return MESSAGE_HEADER + msg + checksum + MESSAGE_FOOTER
410410
411411
412- class PlugwiseRequestWithStickResponse (PlugwiseRequest ):
413- """Base class of a plugwise request resulting in a StickResponse."""
414-
415- async def send (self , suppress_node_errors : bool = False ) -> StickResponse | None :
416- """Send request."""
417- result = await self ._send_request (suppress_node_errors )
418- if isinstance (result , StickResponse ):
419- return result
420- if result is None :
421- return None
422- raise MessageError (
423- f"Invalid response message. Received { result .__class__ .__name__ } , expected NodeAckResponse"
424- )
425-
426-
427412class NodeAddRequest (PlugwiseRequest ):
428413 """Add node to the Plugwise Network and add it to memory of Circle+ node.
429414
430415 Supported protocols : 1.0, 2.0
431- Response message : (@bouwew) b"0000" - StickResponse is returned
416+ Response message : (@bouwew) no Response
432417 """
433418
434419 _identifier = b"0007"
@@ -440,10 +425,18 @@ def __init__(
440425 accept : bool ,
441426 ) -> None :
442427 """Initialize NodeAddRequest message object."""
443- super ().__init__ (None , mac )
428+ super ().__init__ (send_fn , mac )
444429 accept_value = 1 if accept else 0
445430 self ._args .append (Int (accept_value , length = 2 ))
446431
432+ async def send (self , suppress_node_errors : bool = False ) -> None :
433+ """Send request."""
434+ result = await self ._send_request (suppress_node_errors )
435+ if result is not None :
436+ raise MessageError (
437+ f"Invalid response message. Received { result .__class__ .__name__ } , expected no Response"
438+ )
439+
447440 # This message has an exceptional format (MAC at end of message)
448441 # and therefore a need to override the serialize method
449442 def serialize (self ) -> bytes :
0 commit comments