fix(coordinator): poll-only devices refresh — always_update=True (fixes #93)#94
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_datareturns the sameself._statesdict instance every poll. With the coordinator constructedalways_update=False, HA's refresh gate (update_coordinator.py:473-478) comparesprevious_data != self.databy object identity — alwaysFalseafter poll 1 — soasync_update_listeners()never fires. MQTT devices were masked byasync_set_updated_data; BLE-only thermometers (no MQTT push) had no rescue path. Reload "fixed" it only by resettingcoordinator.datatoNone, re-arming the one-shot first fire.Fix
coordinator.py:147always_update=False→always_update=True. Corrects all poll-only devices.Verification
TestCoordinatorAlwaysUpdate)Note
Freshness remains bounded by Govee's gateway→cloud sync cadence (BLE-bridged sensors batch ~30-60s+); upstream, not client-fixable.
Fixes #93