From 52a41d71b0f0dbf94af31541f55eb1f6663f9c84 Mon Sep 17 00:00:00 2001 From: xZetsubou Date: Fri, 17 May 2024 01:42:34 +0300 Subject: [PATCH] Expect timeout error on device update dps. #233 * A workaround for an issue on device >= 3.4, while waiting for correct seqno. --- custom_components/localtuya/coordinator.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/custom_components/localtuya/coordinator.py b/custom_components/localtuya/coordinator.py index cd33451c..bde8c371 100644 --- a/custom_components/localtuya/coordinator.py +++ b/custom_components/localtuya/coordinator.py @@ -390,7 +390,11 @@ async def set_dps(self, states): async def _async_refresh(self, _now): if self._interface is not None: self.debug("Refreshing dps for device") - await self._interface.update_dps(cid=self._node_id) + # This a workdaround for >= 3.4 devices, since there is an issue on waiting for the correct seqno + try: + await self._interface.update_dps(cid=self._node_id) + except TimeoutError: + pass def _dispatch_status(self): signal = f"localtuya_{self._device_config.id}"