Fix misalignments between sql based filtering with the entityfilter based filtering (#72936)
This commit is contained in:
parent
f52fa3599f
commit
5b31414225
5 changed files with 620 additions and 53 deletions
|
@ -2037,7 +2037,7 @@ async def test_include_events_domain_glob(hass, hass_client, recorder_mock):
|
|||
_assert_entry(entries[3], name="included", entity_id=entity_id3)
|
||||
|
||||
|
||||
async def test_include_exclude_events(hass, hass_client, recorder_mock):
|
||||
async def test_include_exclude_events_no_globs(hass, hass_client, recorder_mock):
|
||||
"""Test if events are filtered if include and exclude is configured."""
|
||||
entity_id = "switch.bla"
|
||||
entity_id2 = "sensor.blu"
|
||||
|
@ -2082,13 +2082,15 @@ async def test_include_exclude_events(hass, hass_client, recorder_mock):
|
|||
client = await hass_client()
|
||||
entries = await _async_fetch_logbook(client)
|
||||
|
||||
assert len(entries) == 4
|
||||
assert len(entries) == 6
|
||||
_assert_entry(
|
||||
entries[0], name="Home Assistant", message="started", domain=ha.DOMAIN
|
||||
)
|
||||
_assert_entry(entries[1], name="blu", entity_id=entity_id2, state="10")
|
||||
_assert_entry(entries[2], name="blu", entity_id=entity_id2, state="20")
|
||||
_assert_entry(entries[3], name="keep", entity_id=entity_id4, state="10")
|
||||
_assert_entry(entries[1], name="bla", entity_id=entity_id, state="10")
|
||||
_assert_entry(entries[2], name="blu", entity_id=entity_id2, state="10")
|
||||
_assert_entry(entries[3], name="bla", entity_id=entity_id, state="20")
|
||||
_assert_entry(entries[4], name="blu", entity_id=entity_id2, state="20")
|
||||
_assert_entry(entries[5], name="keep", entity_id=entity_id4, state="10")
|
||||
|
||||
|
||||
async def test_include_exclude_events_with_glob_filters(
|
||||
|
@ -2145,13 +2147,15 @@ async def test_include_exclude_events_with_glob_filters(
|
|||
client = await hass_client()
|
||||
entries = await _async_fetch_logbook(client)
|
||||
|
||||
assert len(entries) == 4
|
||||
assert len(entries) == 6
|
||||
_assert_entry(
|
||||
entries[0], name="Home Assistant", message="started", domain=ha.DOMAIN
|
||||
)
|
||||
_assert_entry(entries[1], name="blu", entity_id=entity_id2, state="10")
|
||||
_assert_entry(entries[2], name="blu", entity_id=entity_id2, state="20")
|
||||
_assert_entry(entries[3], name="included", entity_id=entity_id4, state="30")
|
||||
_assert_entry(entries[1], name="bla", entity_id=entity_id, state="10")
|
||||
_assert_entry(entries[2], name="blu", entity_id=entity_id2, state="10")
|
||||
_assert_entry(entries[3], name="bla", entity_id=entity_id, state="20")
|
||||
_assert_entry(entries[4], name="blu", entity_id=entity_id2, state="20")
|
||||
_assert_entry(entries[5], name="included", entity_id=entity_id4, state="30")
|
||||
|
||||
|
||||
async def test_empty_config(hass, hass_client, recorder_mock):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue