fix: force disconnect on connection reset

This commit is contained in:
Luke Bonaccorsi 2024-03-01 16:53:48 +00:00
parent 0b18494fb1
commit c251501aed
1 changed files with 2 additions and 1 deletions

View File

@ -831,7 +831,8 @@ class TuyaDevice:
if self._connected: if self._connected:
_LOGGER.debug("Incomplete read") _LOGGER.debug("Incomplete read")
elif isinstance(e, ConnectionResetError): elif isinstance(e, ConnectionResetError):
_LOGGER.debug("Connection reset") _LOGGER.debug("Connection reset: {}".format(e))
await self.async_disconnect()
else: else:
_LOGGER.debug("Received message from {}: {}".format(self, message)) _LOGGER.debug("Received message from {}: {}".format(self, message))