diff --git a/miio/miioprotocol.py b/miio/miioprotocol.py index 1075b9642..4575a11d8 100644 --- a/miio/miioprotocol.py +++ b/miio/miioprotocol.py @@ -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,