Skip to content

Commit

Permalink
Fix: reconnecting sub-devices
Browse files Browse the repository at this point in the history
  • Loading branch information
xZetsubou committed Jan 6, 2024
1 parent 4a7d75b commit 10da707
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions custom_components/localtuya/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,9 @@ async def _make_connection(self):
retry += 1
try:
if self.is_subdevice:
await self.get_gateway()
gateway = self._gwateway
# if not gateway or not (gateway.connected and gateway.is_connecting):
# return await self.abort_connect()
if gateway and gateway.is_connecting:
await gateway._connect_task
gateway = await self.get_gateway()
if not gateway or (not gateway.connected or gateway.is_connecting):
return await self.abort_connect()
self._interface = gateway._interface
else:
self._interface = await pytuya.connect(
Expand Down

0 comments on commit 10da707

Please sign in to comment.