mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 06:17:07 +00:00
Fix device_ids being filtered when entities also specified in the logbook (#72122)
This commit is contained in:
parent
a6402697bb
commit
272e65f56d
@ -59,7 +59,6 @@ from homeassistant.helpers.entityfilter import (
|
|||||||
INCLUDE_EXCLUDE_BASE_FILTER_SCHEMA,
|
INCLUDE_EXCLUDE_BASE_FILTER_SCHEMA,
|
||||||
EntityFilter,
|
EntityFilter,
|
||||||
convert_include_exclude_filter,
|
convert_include_exclude_filter,
|
||||||
generate_filter,
|
|
||||||
)
|
)
|
||||||
from homeassistant.helpers.integration_platform import (
|
from homeassistant.helpers.integration_platform import (
|
||||||
async_process_integration_platforms,
|
async_process_integration_platforms,
|
||||||
@ -579,8 +578,8 @@ def _get_events(
|
|||||||
] = hass.data.get(DOMAIN, {})
|
] = hass.data.get(DOMAIN, {})
|
||||||
format_time = _row_time_fired_timestamp if timestamp else _row_time_fired_isoformat
|
format_time = _row_time_fired_timestamp if timestamp else _row_time_fired_isoformat
|
||||||
entity_name_cache = EntityNameCache(hass)
|
entity_name_cache = EntityNameCache(hass)
|
||||||
if entity_ids is not None:
|
if entity_ids or device_ids:
|
||||||
entities_filter = generate_filter([], entity_ids, [], [])
|
entities_filter = None
|
||||||
|
|
||||||
def yield_rows(query: Query) -> Generator[Row, None, None]:
|
def yield_rows(query: Query) -> Generator[Row, None, None]:
|
||||||
"""Yield rows from the database."""
|
"""Yield rows from the database."""
|
||||||
|
@ -2546,10 +2546,13 @@ async def test_get_events_with_device_ids(hass, hass_ws_client, recorder_mock):
|
|||||||
assert response["id"] == 2
|
assert response["id"] == 2
|
||||||
|
|
||||||
results = response["result"]
|
results = response["result"]
|
||||||
assert results[0]["entity_id"] == "light.kitchen"
|
assert results[0]["domain"] == "test"
|
||||||
assert results[0]["state"] == "on"
|
assert results[0]["message"] == "is on fire"
|
||||||
|
assert results[0]["name"] == "device name"
|
||||||
assert results[1]["entity_id"] == "light.kitchen"
|
assert results[1]["entity_id"] == "light.kitchen"
|
||||||
assert results[1]["state"] == "off"
|
assert results[1]["state"] == "on"
|
||||||
|
assert results[2]["entity_id"] == "light.kitchen"
|
||||||
|
assert results[2]["state"] == "off"
|
||||||
|
|
||||||
await client.send_json(
|
await client.send_json(
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user