diff --git a/homeassistant/components/feedreader/event.py b/homeassistant/components/feedreader/event.py index 48c18c4e70d..4b3fb2e2524 100644 --- a/homeassistant/components/feedreader/event.py +++ b/homeassistant/components/feedreader/event.py @@ -19,6 +19,7 @@ from .coordinator import FeedReaderCoordinator LOGGER = logging.getLogger(__name__) ATTR_CONTENT = "content" +ATTR_DESCRIPTION = "description" ATTR_LINK = "link" ATTR_TITLE = "title" @@ -40,7 +41,9 @@ class FeedReaderEvent(CoordinatorEntity[FeedReaderCoordinator], EventEntity): _attr_event_types = [EVENT_FEEDREADER] _attr_name = None _attr_has_entity_name = True - _unrecorded_attributes = frozenset({ATTR_CONTENT, ATTR_TITLE, ATTR_LINK}) + _unrecorded_attributes = frozenset( + {ATTR_CONTENT, ATTR_DESCRIPTION, ATTR_TITLE, ATTR_LINK} + ) coordinator: FeedReaderCoordinator def __init__(self, coordinator: FeedReaderCoordinator) -> None: @@ -80,6 +83,7 @@ class FeedReaderEvent(CoordinatorEntity[FeedReaderCoordinator], EventEntity): self._trigger_event( EVENT_FEEDREADER, { + ATTR_DESCRIPTION: feed_data.get("description"), ATTR_TITLE: feed_data.get("title"), ATTR_LINK: feed_data.get("link"), ATTR_CONTENT: content, diff --git a/tests/components/feedreader/test_event.py b/tests/components/feedreader/test_event.py index 5d903383c05..491c7e38d02 100644 --- a/tests/components/feedreader/test_event.py +++ b/tests/components/feedreader/test_event.py @@ -5,6 +5,7 @@ from unittest.mock import patch from homeassistant.components.feedreader.event import ( ATTR_CONTENT, + ATTR_DESCRIPTION, ATTR_LINK, ATTR_TITLE, ) @@ -35,6 +36,7 @@ async def test_event_entity( assert state.attributes[ATTR_TITLE] == "Title 1" assert state.attributes[ATTR_LINK] == "http://www.example.com/link/1" assert state.attributes[ATTR_CONTENT] == "Content 1" + assert state.attributes[ATTR_DESCRIPTION] == "Description 1" future = dt_util.utcnow() + timedelta(hours=1, seconds=1) async_fire_time_changed(hass, future) @@ -45,6 +47,7 @@ async def test_event_entity( assert state.attributes[ATTR_TITLE] == "Title 2" assert state.attributes[ATTR_LINK] == "http://www.example.com/link/2" assert state.attributes[ATTR_CONTENT] == "Content 2" + assert state.attributes[ATTR_DESCRIPTION] == "Description 2" future = dt_util.utcnow() + timedelta(hours=2, seconds=2) async_fire_time_changed(hass, future) @@ -55,3 +58,4 @@ async def test_event_entity( assert state.attributes[ATTR_TITLE] == "Title 1" assert state.attributes[ATTR_LINK] == "http://www.example.com/link/1" assert state.attributes[ATTR_CONTENT] == "This is a summary" + assert state.attributes[ATTR_DESCRIPTION] == "Description 1"