Skip to content

Commit

Permalink
chore: add debug logging to MessageResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
chemelli74 committed Oct 6, 2024
1 parent 2f4e5d1 commit 0e24488
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions midealocal/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,11 +573,14 @@ def __init__(self, message: bytearray) -> None:
super().__init__()
if message is None or len(message) < self.HEADER_LENGTH + 1:
raise MessageLenError
_LOGGER.debug("MessageResponse - message: %s", message)
self._header = message[: self.HEADER_LENGTH]
_LOGGER.debug("MessageResponse - header: %s", self._header)
self.protocol_version = self._header[-2]
self.message_type = MessageType(self._header[-1])
self.device_type = DeviceType(self._header[2])
body = message[self.HEADER_LENGTH : -1]
_LOGGER.debug("MessageResponse - body : %s", body)
self._body = MessageBody(body)
self.body_type = self._body.body_type

Expand Down

0 comments on commit 0e24488

Please sign in to comment.