Skip to content

Commit

Permalink
tcp: Allow unknown0 to be 0 in addition to UINT16_MAX (#198)
Browse files Browse the repository at this point in the history
As it turns out this field has a different value on a 4000TL(2?): while
it doesn't bring us any closer to the meaning of this field, allow it to
not spam the logs full with it.
  • Loading branch information
MarijnS95 authored May 31, 2022
1 parent 928802e commit 6a36cf3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion omnikinverter/tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def parse_messages(serial_number: int, data: bytes) -> dict[str, Any]:
def _parse_information_reply(data: bytes) -> dict[str, Any]:
tcp_data = _TcpData.from_buffer_copy(data)

if tcp_data.unknown0 != UINT16_MAX: # pragma: no cover
if tcp_data.unknown0 not in [0, UINT16_MAX]: # pragma: no cover
LOGGER.warning("Unexpected unknown0 `%s`", tcp_data.unknown0)

if tcp_data.padding0 != b"\x81\x02\x01": # pragma: no cover
Expand Down

0 comments on commit 6a36cf3

Please sign in to comment.