Skip to content

Commit 82ad165

Browse files
committed
Fix RuntimeError: dictionary changed size during iteration
1 parent 37574b6 commit 82ad165

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

yeelib/discover.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ async def _restart():
113113

114114
async def remove_missing_bulbs(timeout=60):
115115
while True:
116-
missing_bulbs = (
116+
missing_bulbs = [
117117
idx
118118
for idx, bulb in bulbs.items()
119119
if bulb.last_seen < time.time() - timeout
120-
)
120+
]
121121
for idx in missing_bulbs:
122122
logger.info('%r has not been seen in a while and will be removed', bulbs[idx])
123123
del bulbs[idx]

0 commit comments

Comments
 (0)