Skip to content

Commit

Permalink
Fix gateway reconnection issue #530
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Dec 1, 2021
1 parent f346c56 commit 7a23cf9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/xiaomi_gateway3/core/gateway3.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ async def process_gw_stats(self, payload: dict = None):
if self.device.get('stats'):
await self.device['stats'].async_update(payload)

if self.parent_scan_ts and time.time() > self.parent_scan_ts:
if self.available and self.parent_scan_ts and \
time.time() > self.parent_scan_ts:
# block any auto updates in 10 seconds
self.parent_scan_ts = time.time() + 10
await self.run_parent_scan()
Expand Down

0 comments on commit 7a23cf9

Please sign in to comment.