Skip to content

Commit

Permalink
Fix dict unpacking
Browse files Browse the repository at this point in the history
  • Loading branch information
codingjoe committed Apr 7, 2019
1 parent 8d7ae98 commit 37574b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions yeelib/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,12 @@ async def _restart():
async def remove_missing_bulbs(timeout=60):
while True:
missing_bulbs = (
bulb.id
for bulb in bulbs
idx
for idx, bulb in bulbs.items()
if bulb.last_seen < time.time() - timeout
)
for idx in missing_bulbs:
logger.info('%r has not been seen in a while and will be removed', bulbs[idx])
del bulbs[idx]
await asyncio.sleep(timeout/2)

Expand Down

0 comments on commit 37574b6

Please sign in to comment.