Fix for socket.send() exceptions in the logs

This commit is contained in:
rospogrigio
2023-06-07 11:59:31 +02:00
parent 53e1ad8488
commit 9d5984e4cf
2 changed files with 4 additions and 5 deletions

View File

@@ -10,5 +10,5 @@
"iot_class": "local_push", "iot_class": "local_push",
"issue_tracker": "https://github.com/rospogrigio/localtuya/issues", "issue_tracker": "https://github.com/rospogrigio/localtuya/issues",
"requirements": [], "requirements": [],
"version": "5.2.0" "version": "5.2.1"
} }

View File

@@ -766,10 +766,9 @@ class TuyaProtocol(asyncio.Protocol, ContextualLogger):
enc_payload = self._encode_message(payload) enc_payload = self._encode_message(payload)
self.transport.write(enc_payload) self.transport.write(enc_payload)
try:
msg = await self.dispatcher.wait_for(seqno, payload.cmd) msg = await self.dispatcher.wait_for(seqno, payload.cmd)
except Exception as ex: if msg is None:
self.debug("Wait was aborted for seqno %d (%s)", seqno, ex) self.debug("Wait was aborted for seqno %d", seqno)
return None return None
# TODO: Verify stuff, e.g. CRC sequence number? # TODO: Verify stuff, e.g. CRC sequence number?