Skip to content

fix(coordinator): poll-only devices refresh — always_update=True (fixes #93)#94

Merged
lasswellt merged 2 commits into
masterfrom
fix/93-thermometer-stale-update
Jun 4, 2026
Merged

fix(coordinator): poll-only devices refresh — always_update=True (fixes #93)#94
lasswellt merged 2 commits into
masterfrom
fix/93-thermometer-stale-update

Conversation

@lasswellt

Copy link
Copy Markdown
Owner

Summary

H5109 Pool Thermometer (and any poll-only / non-MQTT device) froze its reading after initial load until the integration was reloaded.

Root Cause

_async_update_data returns the same self._states dict instance every poll. With the coordinator constructed always_update=False, HA's refresh gate (update_coordinator.py:473-478) compares previous_data != self.data by object identity — always False after poll 1 — so async_update_listeners() never fires. MQTT devices were masked by async_set_updated_data; BLE-only thermometers (no MQTT push) had no rescue path. Reload "fixed" it only by resetting coordinator.data to None, re-arming the one-shot first fire.

Fix

coordinator.py:147 always_update=Falsealways_update=True. Corrects all poll-only devices.

Verification

  • mypy: PASS
  • flake8: PASS
  • tests: 790 passed (incl. new TestCoordinatorAlwaysUpdate)

Note

Freshness remains bounded by Govee's gateway→cloud sync cadence (BLE-bridged sensors batch ~30-60s+); upstream, not client-fixable.

Fixes #93

Tom Lasswell added 2 commits June 4, 2026 19:18
…fixes #93)

_async_update_data returns the same self._states dict instance every poll.
With always_update=False, HA's coordinator refresh gate compares
previous_data != self.data by object identity, which is always False after
the first poll, so async_update_listeners never fires. MQTT-capable devices
were masked by async_set_updated_data, but BLE-only thermometers (H5109)
with no MQTT push froze their reading until the integration was reloaded.
Regression test asserts always_update stays True.
@lasswellt lasswellt merged commit 1f5ac57 into master Jun 4, 2026
9 checks passed
@lasswellt lasswellt deleted the fix/93-thermometer-stale-update branch June 4, 2026 23:22
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.

H5109 Pool Thermometer does not update temperature

1 participant