Skip to content

Commit 9c33f7c

Browse files
committed
Extend to not expecting both Stick- and NodeResponse
1 parent f422fd3 commit 9c33f7c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

plugwise_usb/connection/sender.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ async def write_request_to_port(self, request: PlugwiseRequest) -> None:
8181
serialized_data = request.serialize()
8282
_LOGGER.debug("write_request_to_port | Write %s to port as %s", request, serialized_data)
8383
self._transport.write(serialized_data)
84-
request.start_response_timeout()
85-
86-
if request.no_stick_response:
84+
# Return when no response expected - NodeAddRequest
85+
if request.no_response_expected:
8786
self._stick_response.cancel()
8887
self._stick_lock.release()
8988
self._processed_msgs += 1
9089
return
9190

91+
request.start_response_timeout()
9292
# Wait for USB stick to accept request
9393
try:
9494
async with timeout(STICK_TIME_OUT):

plugwise_usb/messages/requests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def __init__(
107107
self._response_future: Future[PlugwiseResponse] = self._loop.create_future()
108108
self._waiting_for_response = False
109109

110-
self.no_stick_response = False
110+
self.no_response_expected = False
111111

112112

113113
def __repr__(self) -> str:
@@ -430,7 +430,7 @@ def __init__(
430430
self._args.append(Int(accept_value, length=2))
431431

432432
self.max_retries = 1 # No retrying, will delay the NodeRejoinResponse
433-
self.no_stick_response = True
433+
self.no_response_expected = True
434434

435435
async def send(self) -> None:
436436
"""Send request."""

0 commit comments

Comments
 (0)