Skip to content

Commit

Permalink
Support fragmented responses also in AA55 protocol.
Browse files Browse the repository at this point in the history
  • Loading branch information
mletenay committed May 19, 2024
1 parent 8f562a1 commit 95d4d2c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions goodwe/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,7 @@ def _validate_response(data: bytes, response_type: str) -> bool:
data[-2:] is checksum (plain sum of response data incl. header)
"""
if len(data) <= 8 or len(data) != data[6] + 9:
logger.debug("Response has unexpected length: %d, expected %d.", len(data), data[6] + 9)
return False
raise PartialResponseException(len(data), data[6] + 9)
elif response_type:
data_rt_int = int.from_bytes(data[4:6], byteorder="big", signed=True)
if int(response_type, 16) != data_rt_int:
Expand Down

0 comments on commit 95d4d2c

Please sign in to comment.