Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions custom_components/feedparser/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ def _process_image(self: FeedParserSensor, feed_entry: FeedParserDict) -> str:
if images:
# pick the first image found
return images[0]
elif "enclosure" in feed_entry and feed_entry["enclosure"]:
enc = feed_entry["enclosure"] if feed_entry["enclosure"].type.startswith("image/") else None
if enc and "url" in enc:
return enc["url"]

_LOGGER.debug(
"Feed %s: Image is in inclusions, but no image was found for %s",
self.name,
Expand Down