From c251501aed647f9d8757ae8a4545c484aafc56e8 Mon Sep 17 00:00:00 2001 From: Luke Bonaccorsi Date: Fri, 1 Mar 2024 16:53:48 +0000 Subject: [PATCH] fix: force disconnect on connection reset --- custom_components/robovac/tuyalocalapi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/robovac/tuyalocalapi.py b/custom_components/robovac/tuyalocalapi.py index 5c9e558..8c77926 100644 --- a/custom_components/robovac/tuyalocalapi.py +++ b/custom_components/robovac/tuyalocalapi.py @@ -831,7 +831,8 @@ class TuyaDevice: if self._connected: _LOGGER.debug("Incomplete read") elif isinstance(e, ConnectionResetError): - _LOGGER.debug("Connection reset") + _LOGGER.debug("Connection reset: {}".format(e)) + await self.async_disconnect() else: _LOGGER.debug("Received message from {}: {}".format(self, message))