rmoesbergen / openwrt-ha-device-tracker

OpenWRT device tracker for Home Assistant that actually works
105 stars 18 forks source link

RuntimeError: dictionary changed size during iteration #13

Closed Karl483r closed 1 year ago

Karl483r commented 1 year ago

Hi, thanks for your script, most of the time it works perfectly!

From time to time I get this exception:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 980, in _bootstrap_inner
  File "/etc/config/presence-detector.py", line 198, in run
    self.full_sync()
  File "/etc/config/presence-detector.py", line 108, in full_sync
    for client, offline_after in self._clients_seen.items():
RuntimeError: dictionary changed size during iteration

Any idea how to fix that?

Thanks!

rmoesbergen commented 1 year ago

@Karl483r Thanks for the report! Should be fixed in 'main'. Can you confirm this works? I'll do a release once we're sure the bug is fixed.

Karl483r commented 1 year ago

Thank you! I will try the fix and report back. But could take a few days, as the error only occurs occasionally.

Karl483r commented 1 year ago

So far everything works fine! Thank you!

rmoesbergen commented 1 year ago

Nice :) I'll create a release. Thanks for reporting back!