Mark counter domain as continuous to exclude it from logbook (#73101)

This commit is contained in:
J. Nick Koston 2022-06-05 21:25:26 -10:00 committed by GitHub
parent 457c7a4ddc
commit 0b62944148
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 66 additions and 20 deletions

View file

@ -2209,7 +2209,9 @@ async def test_recorder_is_far_behind(hass, recorder_mock, hass_ws_client, caplo
@patch("homeassistant.components.logbook.websocket_api.EVENT_COALESCE_TIME", 0)
async def test_subscribe_all_entities_have_uom(hass, recorder_mock, hass_ws_client):
async def test_subscribe_all_entities_are_continuous(
hass, recorder_mock, hass_ws_client
):
"""Test subscribe/unsubscribe logbook stream with entities that are always filtered."""
now = dt_util.utcnow()
await asyncio.gather(
@ -2227,6 +2229,8 @@ async def test_subscribe_all_entities_have_uom(hass, recorder_mock, hass_ws_clie
hass.states.async_set(
entity_id, state, {ATTR_UNIT_OF_MEASUREMENT: "any"}
)
hass.states.async_set("counter.any", state)
hass.states.async_set("proximity.any", state)
init_count = sum(hass.bus.async_listeners().values())
_cycle_entities()
@ -2238,7 +2242,7 @@ async def test_subscribe_all_entities_have_uom(hass, recorder_mock, hass_ws_clie
"id": 7,
"type": "logbook/event_stream",
"start_time": now.isoformat(),
"entity_ids": ["sensor.uom"],
"entity_ids": ["sensor.uom", "counter.any", "proximity.any"],
}
)