Skip to content

Commit 37574b6

Browse files
committed
Fix dict unpacking
1 parent 8d7ae98 commit 37574b6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

yeelib/discover.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,12 @@ async def _restart():
114114
async def remove_missing_bulbs(timeout=60):
115115
while True:
116116
missing_bulbs = (
117-
bulb.id
118-
for bulb in bulbs
117+
idx
118+
for idx, bulb in bulbs.items()
119119
if bulb.last_seen < time.time() - timeout
120120
)
121121
for idx in missing_bulbs:
122+
logger.info('%r has not been seen in a while and will be removed', bulbs[idx])
122123
del bulbs[idx]
123124
await asyncio.sleep(timeout/2)
124125

0 commit comments

Comments
 (0)