Skip to content

Reduce PoolLab polling and skip unchanged sensor updates - #73

Open
hmmbob wants to merge 2 commits into
dala318:mainfrom
hmmbob:fix/poollab-polling
Open

hmmbob wants to merge 2 commits into
dala318:mainfrom
hmmbob:fix/poollab-polling

Conversation

@hmmbob

@hmmbob hmmbob commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Big thanks to @cococheaf in #69

PoolLab currently fetches the full cloud account every 30 seconds and writes every measurement sensor on every coordinator notification. Poll every 15 minutes and suppress equal account snapshots and unchanged individual measurements, while still reporting connection loss, recovery, and corrections to measurement metadata.

Use a shared 30-second timeout for the coordinator, GraphQL execution, and HTTP transport. Increasing only the coordinator deadline would leave GraphQL's default 10-second timeout in place. The longer polling interval means a new cloud measurement can take up to 15 minutes to appear; manual refresh remains available.

This addresses the remaining polling and sensor-update work in #69, fixes #69. Clearer error messages are handled separately in #70, and existing test/translation cleanup in #71. #72 handles the unrelated config-entry reload warning. All four PRs can be merged independently; neither the error-message tests nor the initialization test depends on these timing settings.

Validation:

This also fixes #67. Two tests set up three real Home Assistant sensors, then sync a new day of pH and chlorine measurements while leaving CYA unchanged. CYA retains last_changed, last_updated, last_reported, and measured_at. New measurements still update measured_at and last_updated when their numeric value is unchanged.

On current Home Assistant, the original handler reproduces a redundant last_reported update; last_updated and measured_at already remain unchanged when the state and attributes are equal. The integration's measured_at attribute is the source measurement time and should be used for measurement-age reminders. Home Assistant state timestamps describe state activity and can legitimately change on availability transitions or metadata corrections.

Reference: https://www.home-assistant.io/docs/configuration/state_object/

schford added a commit to schford/python_poollab that referenced this pull request Oct 22, 2026
schford added a commit to schford/python_poollab that referenced this pull request Oct 22, 2026
- hacs.json: drop zip_release/filename (no release workflow runs on the fork)
- manifest.json: version 1.3.1-sf1
- README: fork note naming the carried upstream PRs dala318#70-dala318#73

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix excessive polling and unchanged sensor state writes Entity timestamps update for unmeasured parameters during partial pool lab sync

1 participant