Skip to content

Fix excessive polling and unchanged sensor state writes #69

Description

@cococheaf

Hi,

I ran into repeated PoolLab API errors in Home Assistant and noticed that the integration currently polls every 30 seconds and writes sensor state updates even when the measurement did not actually change.

This patch changes:

  • polling interval from 30 seconds to 15 minutes
  • API timeout from 10 seconds to 30 seconds
  • clearer UpdateFailed messages with the original exception type
  • sensors only write state when measurement id, timestamp or value changed
  • tests for coordinator interval/error reporting and unchanged sensor updates

This should reduce unnecessary recorder writes and avoid misleading last_updated changes for old PoolLab measurements.

Tested with:

uv run --python 3.13 --with-requirements requirements.test.txt pytest tests/test_coordinator.py tests/test_sensor.py --no-cov

Result: 4 passed.
Patch attached.

Please check and implement.

Thank you

poollab-fix-20260821.patch

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions