Skip to content

Commit d34e768

Browse files
committed
Remove reduced logging
1 parent 1c3d21f commit d34e768

File tree

4 files changed

+6
-54
lines changed

4 files changed

+6
-54
lines changed

plugwise_usb/connection/__init__.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,6 @@ def __init__(self) -> None:
3333
self._network_id: int | None = None
3434
self._network_online = False
3535

36-
@property
37-
def reduce_receive_logging(self) -> bool:
38-
"""Return if logging must reduced."""
39-
return self._manager.reduce_receive_logging
40-
41-
@reduce_receive_logging.setter
42-
def reduce_receive_logging(self, state: bool) -> None:
43-
"""Reduce logging of unhandled received messages."""
44-
self._manager.reduce_receive_logging = state
45-
4636
@property
4737
def is_initialized(self) -> bool:
4838
"""Returns True if UBS-Stick connection is active and initialized."""

plugwise_usb/connection/manager.py

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

39-
@property
40-
def reduce_receive_logging(self) -> bool:
41-
"""Return if logging must reduced."""
42-
if self._receiver is None:
43-
raise StickError(
44-
"Unable to return log settings when connection is not active."
45-
)
46-
return self._receiver.reduce_logging
47-
48-
@reduce_receive_logging.setter
49-
def reduce_receive_logging(self, state: bool) -> None:
50-
"""Reduce logging of unhandled received messages."""
51-
if self._receiver is None:
52-
raise StickError(
53-
"Unable to set log settings when connection is not active."
54-
)
55-
self._receiver.reduce_logging = state
56-
5739
@property
5840
def serial_path(self) -> str:
5941
"""Return current port."""

plugwise_usb/connection/receiver.py

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def __init__(
9191
self._transport: SerialTransport | None = None
9292
self._buffer: bytes = bytes([])
9393
self._connection_state = False
94-
self._reduce_logging = True
9594
self._receive_queue: PriorityQueue[PlugwiseResponse] = PriorityQueue()
9695
self._last_processed_messages: list[bytes] = []
9796
self._responses: dict[bytes, Callable[[PlugwiseResponse], None]] = {}
@@ -127,16 +126,6 @@ def is_connected(self) -> bool:
127126
"""Return current connection state of the USB-Stick."""
128127
return self._connection_state
129128

130-
@property
131-
def reduce_logging(self) -> bool:
132-
"""Return if logging must reduced."""
133-
return self._reduce_logging
134-
135-
@reduce_logging.setter
136-
def reduce_logging(self, reduce_logging: bool) -> None:
137-
"""Reduce logging."""
138-
self._reduce_logging = reduce_logging
139-
140129
def connection_made(self, transport: SerialTransport) -> None:
141130
"""Call when the serial connection to USB-Stick is established."""
142131
_LOGGER.info("Connection made")
@@ -398,20 +387,12 @@ async def _notify_node_response_subscribers(
398387
return
399388

400389
if node_response.retries > 10:
401-
if self._reduce_logging:
402-
_LOGGER.debug(
403-
"No subscriber to handle %s, seq_id=%s from %s after 10 retries",
404-
node_response.__class__.__name__,
405-
node_response.seq_id,
406-
node_response.mac_decoded,
407-
)
408-
else:
409-
_LOGGER.warning(
410-
"No subscriber to handle %s, seq_id=%s from %s after 10 retries",
411-
node_response.__class__.__name__,
412-
node_response.seq_id,
413-
node_response.mac_decoded,
414-
)
390+
_LOGGER.warning(
391+
"No subscriber to handle %s, seq_id=%s from %s after 10 retries",
392+
node_response.__class__.__name__,
393+
node_response.seq_id,
394+
node_response.mac_decoded,
395+
)
415396
return
416397
node_response.retries += 1
417398
if node_response.retries > 2:

plugwise_usb/network/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ async def _discover_registered_nodes(self) -> None:
421421
counter += 1
422422
await sleep(0)
423423
_LOGGER.debug("Total %s registered node(s)", str(counter))
424-
self._controller.reduce_receive_logging = False
425424

426425
async def _load_node(self, mac: str) -> bool:
427426
"""Load node."""

0 commit comments

Comments
 (0)