Skip to content

Commit 353177a

Browse files
committed
Enforce rss domain names
1 parent e04820a commit 353177a

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

appdaemon/rundash.py

+8
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ def __init__(self, ad, loop, logger, access, **config):
107107
self.rss_feeds = None
108108
self._process_arg("rss_feeds", config)
109109

110+
if "rss_feeds" in config:
111+
self.rss_feeds = []
112+
for feed in config["rss_feeds"]:
113+
if feed["target"].count('.') != 1:
114+
self.log("WARNING", "Invalid RSS feed target: {}".format(feed["target"]))
115+
else:
116+
self.rss_feeds.append(feed)
117+
110118
self.rss_update = None
111119
self._process_arg("rss_update", config)
112120

docs/DASHBOARD_CREATION.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ Note that the actual feeds are configured in appdaemon.yaml as follows:
978978
- ``feed_url`` - fully qualified path to rss feed, e.g.
979979
``http://rss.cnn.com/rss/cnn_topstories.rss``
980980
- ``target name`` - the entity of the target RSS widget in the
981-
dashboard definition file
981+
dashboard definition file. This must be an arbitary name prepended by ``rss.`` - e.g. ``rss.cnn_news``
982982
- ``feed_refresh_interval`` - how often AppDaemon will refresh the RSS
983983
feeds
984984

@@ -992,7 +992,7 @@ Mandatory Arguments:
992992
^^^^^^^^^^^^^^^^^^^^
993993

994994
- ``entity`` - the name of the configured feed - this must match the
995-
``target_name`` configured in the AppDaemon configuration
995+
``target_name`` full target name configured in the AppDaemon configuration e.g. `rss.cnn_news`
996996
- ``interval`` - the period between display of different items within
997997
the feed
998998

docs/HISTORY.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ Change Log
1111
**Fixes**
1212

1313
- Fixed incorrect service call in ``set_value()``
14+
- Enforce domain name in rss feed target
1415

1516
**Breaking Changes**
1617

17-
None
18+
- RSS target names must now consist of a domain as well as the target name, e.g. ``rss.cnn_news``
1819

1920
3.0.1
2021
------------------

0 commit comments

Comments
 (0)