From bb41a2df9f62909ef5d5bbb844447d63515ff28a Mon Sep 17 00:00:00 2001 From: Yabing Yi <102894372+5-bean-curd@users.noreply.github.com> Date: Wed, 29 Apr 2026 16:58:13 +0800 Subject: [PATCH] Fix logbook spam by including image domain in ALWAYS_CONTINUOUS_DOMAINS (#169240) Co-authored-by: Claude Code Co-authored-by: Claude Opus 4.6 Co-authored-by: Martin Hjelmare --- homeassistant/components/logbook/const.py | 4 ++-- tests/components/logbook/test_websocket_api.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/logbook/const.py b/homeassistant/components/logbook/const.py index 282580bdc95c..abbd5c8f050d 100644 --- a/homeassistant/components/logbook/const.py +++ b/homeassistant/components/logbook/const.py @@ -11,9 +11,9 @@ from homeassistant.const import EVENT_CALL_SERVICE, EVENT_LOGBOOK_ENTRY # Domains that are always continuous # # These are hard coded here to avoid importing -# the entire counter and proximity integrations +# the entire counter, image, and proximity integrations # to get the name of the domain. -ALWAYS_CONTINUOUS_DOMAINS = {"counter", "proximity"} +ALWAYS_CONTINUOUS_DOMAINS = {"counter", "image", "proximity"} # Domains that are continuous if there is a UOM set on the entity CONDITIONALLY_CONTINUOUS_DOMAINS = {SENSOR_DOMAIN} diff --git a/tests/components/logbook/test_websocket_api.py b/tests/components/logbook/test_websocket_api.py index ab12f84b5108..708aec772043 100644 --- a/tests/components/logbook/test_websocket_api.py +++ b/tests/components/logbook/test_websocket_api.py @@ -2559,6 +2559,7 @@ async def test_subscribe_all_entities_are_continuous( entity_id, state, {ATTR_UNIT_OF_MEASUREMENT: "any"} ) hass.states.async_set("counter.any", state) + hass.states.async_set("image.any", state) hass.states.async_set("proximity.any", state) # We will compare event subscriptions after closing the websocket connection, @@ -2573,7 +2574,7 @@ async def test_subscribe_all_entities_are_continuous( "id": 7, "type": "logbook/event_stream", "start_time": now.isoformat(), - "entity_ids": ["sensor.uom", "counter.any", "proximity.any"], + "entity_ids": ["sensor.uom", "counter.any", "image.any", "proximity.any"], } ) @@ -2908,6 +2909,7 @@ async def test_subscribe_all_entities_are_continuous_with_device( entity_id, state, {ATTR_UNIT_OF_MEASUREMENT: "any"} ) hass.states.async_set("counter.any", state) + hass.states.async_set("image.any", state) hass.states.async_set("proximity.any", state) hass.bus.async_fire("mock_event", {"device_id": device.id}) hass.bus.async_fire("mock_event", {"device_id": device2.id}) @@ -2924,7 +2926,7 @@ async def test_subscribe_all_entities_are_continuous_with_device( "id": 7, "type": "logbook/event_stream", "start_time": now.isoformat(), - "entity_ids": ["sensor.uom", "counter.any", "proximity.any"], + "entity_ids": ["sensor.uom", "counter.any", "image.any", "proximity.any"], "device_ids": [device.id, device2.id], } ) @@ -3113,6 +3115,11 @@ async def test_live_stream_with_changed_state_change( {}, 0, # Counter is an always continuous domain ), + ( + "image.map0", + {}, + 0, # Image is an always continuous domain + ), ( "zone.home", {},