Fix feed entry updates, options reload, and config flow UX - #163
Open
Chreece wants to merge 1 commit into
Open
Conversation
Chreece
force-pushed
the
fix/feed-entry-updates-options-ux
branch
from
September 9, 2026 05:23
504517e to
adc0ea4
Compare
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
This fixes two issues in the 1.0.0 config-entry implementation and improves the Feedparser setup/options forms:
entrieslist on each successful poll so Home Assistant can detect real attribute changes;OptionsFlowWithReloadso saved options actually reload the config entry;Why the
entrieschange is neededFeedParserSensor.update()currently clears and extends the existing_entrieslist in place. Home Assistant state attributes are read-only only at the outer mapping level; nested values such as lists are not deep-copied. The previous HAStatetherefore retains a reference to the same list.When the next feed poll mutates that list, the
entriesvalue visible through the previous state is mutated as well. Home Assistant then compares the old and new attributes as equal. In particular, state triggers watchingattribute: entriesskip the update because the old and new attribute values compare equal.The fix assigns a new list for every successful parse instead of mutating the existing list. The redundant
_attr_extra_state_attributesassignment is also removed becauseextra_state_attributesis already implemented as a property returning the current entries.Why the options-flow change is needed
The current flow subclasses
OptionsFlowand setsautomatic_reload = True. Current Home Assistant only honors automatic reload forOptionsFlowWithReload. As a result, updated options are stored but settings that are consumed during entity-platform setup, such asscan_interval, may not take effect until the config entry is reloaded or Home Assistant restarts.Using
OptionsFlowWithReloadapplies saved options through the supported Home Assistant mechanism.Config-flow UX
The setup/options UI is also adjusted to use current Home Assistant selectors and clearer wording:
Refresh intervalduration control instead of separate hour/minute inputs;Maximum entriesuses a numeric box control;Persisted
scan_intervaldata remains in the existing duration-dict shape, so no config-entry migration is required for this UI change.Regression coverage
Added tests cover:
OptionsFlowWithReload;Validation / reproduction evidence
The failure was reproduced on Home Assistant 2026.9.1 with a polling feed:
entrieslist was the exact same list object and changed when_entries.clear()/_entries.extend()ran;attribute: entriesconsumer remained stale during normal polls but refreshed when the Feedparser config entry was reloaded, which creates a new entity/list object.Local static checks completed for this patch:
git diff --checksucceeds.The full pytest suite was not run in the patch-preparation container because the
homeassistantpackage is not installed there. CI should run the repository's normal test/lint gates.