Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
Revert "fix unhadled exception on scan timeout (#5)" (#10)
Browse files Browse the repository at this point in the history
This reverts commit 49fb8c7.
  • Loading branch information
Adminiuga authored Feb 16, 2020
1 parent 9ef57df commit 0a4b775
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions custom_components/zha_map/neighbour.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,13 @@ async def scan(self):
"""Scan for neighbours."""
idx = 0
while True:
try:
status, val = await self.device.zdo.request(
zdo_t.ZDOCmd.Mgmt_Lqi_req, idx, tries=3, delay=1
)
self.debug("neighbor request Status: %s. Response: %r", status, val)
if zdo_t.Status.SUCCESS != status:
self.supported = False
self.debug("device does not support 'Mgmt_Lqi_req'")
return
except asyncio.TimeoutError:
self.debug("'Mgmt_Lqi_req' timedout")
status, val = await self.device.zdo.request(
zdo_t.ZDOCmd.Mgmt_Lqi_req, idx, tries=3, delay=1
)
self.debug("neighbor request Status: %s. Response: %r", status, val)
if zdo_t.Status.SUCCESS != status:
self.supported = False
self.debug("device does not support 'Mgmt_Lqi_req'")
return

neighbors = val.NeighborTableList
Expand Down

0 comments on commit 0a4b775

Please sign in to comment.