diff --git a/homeassistant/components/update/recorder.py b/homeassistant/components/update/recorder.py index cba4cab8ec2..1b22360761f 100644 --- a/homeassistant/components/update/recorder.py +++ b/homeassistant/components/update/recorder.py @@ -1,12 +1,13 @@ """Integration platform for recorder.""" from __future__ import annotations +from homeassistant.const import ATTR_ENTITY_PICTURE from homeassistant.core import HomeAssistant, callback -from . import ATTR_IN_PROGRESS, ATTR_RELEASE_SUMMARY +from .const import ATTR_IN_PROGRESS, ATTR_RELEASE_SUMMARY @callback def exclude_attributes(hass: HomeAssistant) -> set[str]: """Exclude large and chatty update attributes from being recorded in the database.""" - return {ATTR_IN_PROGRESS, ATTR_RELEASE_SUMMARY} + return {ATTR_ENTITY_PICTURE, ATTR_IN_PROGRESS, ATTR_RELEASE_SUMMARY} diff --git a/tests/components/update/test_recorder.py b/tests/components/update/test_recorder.py index 6d4ec567182..9e1767c190c 100644 --- a/tests/components/update/test_recorder.py +++ b/tests/components/update/test_recorder.py @@ -11,7 +11,7 @@ from homeassistant.components.update.const import ( ATTR_RELEASE_SUMMARY, DOMAIN, ) -from homeassistant.const import CONF_PLATFORM +from homeassistant.const import ATTR_ENTITY_PICTURE, CONF_PLATFORM from homeassistant.core import HomeAssistant, State from homeassistant.setup import async_setup_component from homeassistant.util import dt as dt_util @@ -31,6 +31,10 @@ async def test_exclude_attributes( await hass.async_block_till_done() state = hass.states.get("update.update_already_in_progress") assert state.attributes[ATTR_IN_PROGRESS] == 50 + assert ( + state.attributes[ATTR_ENTITY_PICTURE] + == "https://brands.home-assistant.io/_/test/icon.png" + ) await async_setup_component(hass, DOMAIN, {}) await hass.async_block_till_done() @@ -50,6 +54,7 @@ async def test_exclude_attributes( states: list[State] = await hass.async_add_executor_job(_fetch_states) assert len(states) > 1 for state in states: + assert ATTR_ENTITY_PICTURE not in state.attributes assert ATTR_IN_PROGRESS not in state.attributes assert ATTR_RELEASE_SUMMARY not in state.attributes assert ATTR_INSTALLED_VERSION in state.attributes