mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Remove unnecessary assignment of Template.hass from rss_feed_template (#123683)
This commit is contained in:
parent
268044cd01
commit
81788790df
@ -49,18 +49,8 @@ def setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|||||||
|
|
||||||
requires_auth: bool = feedconfig["requires_api_password"]
|
requires_auth: bool = feedconfig["requires_api_password"]
|
||||||
|
|
||||||
title: Template | None
|
|
||||||
if (title := feedconfig.get("title")) is not None:
|
|
||||||
title.hass = hass
|
|
||||||
|
|
||||||
items: list[dict[str, Template]] = feedconfig["items"]
|
items: list[dict[str, Template]] = feedconfig["items"]
|
||||||
for item in items:
|
rss_view = RssView(url, requires_auth, feedconfig.get("title"), items)
|
||||||
if "title" in item:
|
|
||||||
item["title"].hass = hass
|
|
||||||
if "description" in item:
|
|
||||||
item["description"].hass = hass
|
|
||||||
|
|
||||||
rss_view = RssView(url, requires_auth, title, items)
|
|
||||||
hass.http.register_view(rss_view)
|
hass.http.register_view(rss_view)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user