Skip to content

Commit

Permalink
Don't send warning disconnect dc is intended
Browse files Browse the repository at this point in the history
  • Loading branch information
xZetsubou committed Oct 16, 2023
1 parent 7e1b4e3 commit d8e25e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions custom_components/localtuya/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit d8e25e6

Please sign in to comment.