mirror of
https://github.com/home-assistant/core.git
synced 2026-08-29 01:26:17 +01:00
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:
co-authored by
Claude Code
Claude Opus 4.6
Martin Hjelmare
parent
284242b90e
commit
bb41a2df9f
@@ -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",
|
||||
{},
|
||||
|
||||
Reference in New Issue
Block a user