Skip to content

Commit f834e20

Browse files
committed
Remove all request/response counter related
1 parent 727ecc2 commit f834e20

File tree

4 files changed

+0
-24
lines changed

4 files changed

+0
-24
lines changed

plugwise_usb/connection/manager.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ def __init__(self) -> None:
3636
] = {}
3737
self._unsubscribe_stick_events: Callable[[], None] | None = None
3838

39-
def correct_received_messages(self, correction: int) -> None:
40-
"""Correct received messages count."""
41-
self._receiver.correct_processed_messages(correction)
42-
4339
@property
4440
def serial_path(self) -> str:
4541
"""Return current port."""

plugwise_usb/connection/queue.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,11 @@ async def submit(self, request: PlugwiseRequest) -> PlugwiseResponse | None:
112112
_LOGGER.warning("%s, cancel request", exc) # type: ignore[unreachable]
113113
except StickError as exc:
114114
_LOGGER.error(exc)
115-
self._stick.correct_received_messages(1)
116115
raise StickError(
117116
f"No response received for {request.__class__.__name__} "
118117
+ f"to {request.mac_decoded}"
119118
) from exc
120119
except BaseException as exc:
121-
self._stick.correct_received_messages(1)
122120
raise StickError(
123121
f"No response received for {request.__class__.__name__} "
124122
+ f"to {request.mac_decoded}"

plugwise_usb/connection/receiver.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ def __init__(
9999
self._data_worker_task: Task[None] | None = None
100100

101101
# Message processing
102-
self._processed_msgs = 0
103102
self._message_queue: PriorityQueue[PlugwiseResponse] = PriorityQueue()
104103
self._last_processed_messages: list[bytes] = []
105104
self._current_seq_id: bytes | None = None
@@ -138,20 +137,11 @@ def connection_lost(self, exc: Exception | None = None) -> None:
138137
self._transport = None
139138
self._connection_state = False
140139

141-
@property
142-
def processed_messages(self) -> int:
143-
"""Return the number of processed messages."""
144-
return self._processed_msgs
145-
146140
@property
147141
def is_connected(self) -> bool:
148142
"""Return current connection state of the USB-Stick."""
149143
return self._connection_state
150144

151-
def correct_processed_messages(self, correction: int) -> None:
152-
"""Correct the number of processed messages."""
153-
self._processed_msgs += correction
154-
155145
def connection_made(self, transport: SerialTransport) -> None:
156146
"""Call when the serial connection to USB-Stick is established."""
157147
_LOGGER.info("Connection made")
@@ -291,7 +281,6 @@ async def _message_queue_worker(self) -> None:
291281
await self._notify_stick_subscribers(response)
292282
else:
293283
await self._notify_node_response_subscribers(response)
294-
self._processed_msgs += 1
295284
self._message_queue.task_done()
296285
await sleep(0)
297286
_LOGGER.debug("Message queue worker stopped")

plugwise_usb/connection/sender.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,11 @@ def __init__(self, stick_receiver: StickReceiver, transport: Transport) -> None:
3838
self._loop = get_running_loop()
3939
self._receiver = stick_receiver
4040
self._transport = transport
41-
self._processed_msgs = 0
4241
self._stick_response: Future[StickResponse] | None = None
4342
self._stick_lock = Lock()
4443
self._current_request: None | PlugwiseRequest = None
4544
self._unsubscribe_stick_response: Callable[[], None] | None = None
4645

47-
@property
48-
def processed_messages(self) -> int:
49-
"""Return the number of processed messages."""
50-
return self._processed_msgs
51-
5246
async def start(self) -> None:
5347
"""Start the sender."""
5448
# Subscribe to ACCEPT stick responses, which contain the seq_id we need.
@@ -149,7 +143,6 @@ async def write_request_to_port(self, request: PlugwiseRequest) -> None:
149143
finally:
150144
self._stick_response.cancel()
151145
self._stick_lock.release()
152-
self._processed_msgs += 1
153146

154147
async def _process_stick_response(self, response: StickResponse) -> None:
155148
"""Process stick response."""

0 commit comments

Comments
 (0)