Repository navigation
Read the feed URL from an entity (dynamic feed URLs) - #176
Merged
Merged
Conversation
Some feeds publish a new URL every day (issue #60). Instead of rendering templates in the integration, a feed can now take its URL from an input_text, text or template sensor entity, in the UI and in YAML (feed_url_entity). The URL is read on every poll, and the feed is refreshed as soon as the entity's value changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Closes #60.
Why
Some feeds publish a new URL every day (the issue's example is a TV listing named
programme-tv-rss_DD-MM-YYYY.xml). The integration usedfeed_urlexactly as typed, so{{ now()... }}was requested literally and failed withInvalidURL.This change doesn't render Jinja inside the integration. Instead, a feed can take its URL from an entity's state. Users build the URL with a template sensor helper, or set it from an automation with
input_text.set_value, so Home Assistant does the templating.What changed
feed_url_entitysource. It can be aninput_text,textorsensorentity, and works both in the UI and in YAML. A feed uses eitherfeed_urlorfeed_url_entity, never both.FeedReader.read(url).unknown/unavailable, such as a helper reloading, doesn't trigger a refresh, so the entries stay until the next poll.UpdateFailed. At startup that means a setup retry, the same as an unreachable feed.Feed URLorFeed URL entity(an entity selector).url_or_entity,entity_no_urlandentity_invalid_url.feed_urlandfeed_url_entity, and the entity's domain is checked.source.pyholds the entity lookup and URL check.is_supported_urlmoved there from the config flow.For reviewers
input_textdefaults to a maximum of 100. The README says both.unavailableuntil the value changes.tests/test_url_entity.pycovers both setup paths, refresh on change, unknown/unavailable handling, setup retry, unload, duplicates, switching on reconfigure and in YAML, and schema rejections. The full suite passes (239 tests), and ruff and mypy are clean.🤖 Generated with Claude Code