Improvements
First-principles review against Home Assistant's current integration conventions (verified against a real, live 2026.7.1 install):
- Actual state polling. Previously the light state was only ever read from a value cached at initial setup — HA's periodic poll silently did nothing (no
update()/async_update()override), so a light toggled from the Haven app or a physical switch would never be reflected in HA. Now a sharedDataUpdateCoordinatorpolls once per location every 60s (deliberately conservative), and commands trigger an immediate refresh instead of waiting for the next poll. - Proper setup-failure signaling.
async_setup_entrynow raisesConfigEntryNotReadyfor transient failures (auto-retried by HA) orConfigEntryAuthFailedfor bad/expired credentials, which now surfaces a reauthentication prompt instead of requiring you to delete and re-add the integration. - Fixed the "Location" device grouping — lights weren't actually grouping under a location device; the reference was silently dropped because the device was never registered.
- Fixed a "Kitchen Kitchen"-style duplicate-name bug in the entity display name.
- Modernized to the
entry.runtime_datastorage pattern, and requireshavenlighting>=0.2.1for its newLocation.idproperty.
Verified end-to-end against a live account: coordinator polling confirmed, location device grouping confirmed, and a real on/off cycle reflected correctly in the UI.