You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(coordinator): auto-discover devices added after startup (#101) (#111)
Device discovery was one-shot at config-entry setup, so devices added to the
Govee account after Home Assistant started stayed invisible until a manual
reload (issue #101 — 8 new H5059 sensors on an H5044 hub didn't appear until
the integration was reloaded).
Add a throttled device-list re-check to the poll loop: every
DEVICE_REDISCOVERY_INTERVAL (300s, well above the poll cadence to respect the
100/min, 10k/day API limits) re-fetch the device list; if a genuinely new
device id appears, schedule a config-entry reload, which re-runs the existing,
tested discovery + platform setup so the new entities are created.
Deliberately reuses the proven reload path rather than refactoring dynamic
entity addition across all ~10 platforms — far smaller regression surface for
the same user-visible result. Only additions trigger a reload (removals stay
tied to reload/restart + the existing orphan cleanup), the group filter is
applied so a disabled group can't reload-loop, and the re-check is
failure-isolated so a discovery hiccup never fails the state poll.
Also corrects the quality_scale.yaml dynamic-devices comment, which previously
claimed polling handled this (it didn't).
Adds TestPeriodicRediscovery (reload on new device, no-op when unchanged,
throttle, failure isolation, disabled-group ignore). Closes#101.
Co-authored-by: Tom Lasswell <tom@calcyon.com>
0 commit comments