Skip to content

Commit

Permalink
Print debug recv contents prior accessing its contents (#1293)
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti authored Jan 12, 2022
1 parent 069bee8 commit 9bc6b65
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions miio/miioprotocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,15 @@ def send(
data, addr = s.recvfrom(4096)
m = Message.parse(data, token=self.token)

if self.debug > 1:
_LOGGER.debug("recv from %s: %s", addr[0], m)

header = m.header.value
payload = m.data.value

self.__id = payload["id"]
self._device_ts = header["ts"] # type: ignore # ts uses timeadapter

if self.debug > 1:
_LOGGER.debug("recv from %s: %s", addr[0], m)

_LOGGER.debug(
"%s:%s (ts: %s, id: %s) << %s",
self.ip,
Expand Down

0 comments on commit 9bc6b65

Please sign in to comment.