Fix logbook spam by including image domain in ALWAYS_CONTINUOUS_DOMAINS (#169240)

Co-authored-by: Claude Code <claude@anthropic.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Yabing Yi
2026-04-29 10:58:13 +02:00
committed by GitHub
co-authored by Claude Code Claude Opus 4.6 Martin Hjelmare
parent 284242b90e
commit bb41a2df9f
2 changed files with 11 additions and 4 deletions
+2 -2
View File
@@ -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}
@@ -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",
{},