diff --git a/custom_components/localtuya/common.py b/custom_components/localtuya/common.py index da515dcd5..d3c642e8a 100644 --- a/custom_components/localtuya/common.py +++ b/custom_components/localtuya/common.py @@ -298,6 +298,8 @@ async def _make_connection(self): self.warning(f"Initial state update failed {e}, trying key update") await self.update_local_key() await self.abort_connect() + finally: + pass if self._interface is not None: # Attempt to restore status for all entities that need to first set @@ -473,10 +475,9 @@ def disconnected(self): self._connect_task = None # If it's disconnect by unexpected error. if self._is_closing is not True: + self.warning("Disconnected - waiting for discovery broadcast") self._is_closing = True self._hass.create_task(self.async_connect()) - else: - self.warning("Disconnected - waiting for discovery broadcast") class LocalTuyaEntity(RestoreEntity, pytuya.ContextualLogger):