Skip to content

Commit

Permalink
Fix restore state for check_connection #112
Browse files Browse the repository at this point in the history
  • Loading branch information
xZetsubou committed Jan 15, 2024
1 parent 8c10657 commit a2f3bb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/localtuya/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,9 @@ async def abort_connect(self):

async def check_connection(self):
"""Ensure that the device is not still connecting; if it is, wait for it."""
if self._connect_task:
if not self.connected and self._connect_task:
await self._connect_task
if self._gwateway and self._gwateway._connect_task:
if not self.connected and self._gwateway and self._gwateway._connect_task:
await self._gwateway._connect_task

async def close(self):
Expand Down

0 comments on commit a2f3bb0

Please sign in to comment.