mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 00:37:13 +00:00
Make sure empty get_events results is always a list (#72021)
This commit is contained in:
parent
8f4caf4141
commit
5433c0a535
@ -271,7 +271,7 @@ async def ws_get_events(
|
|||||||
return
|
return
|
||||||
|
|
||||||
if start_time > utc_now:
|
if start_time > utc_now:
|
||||||
connection.send_result(msg["id"], {})
|
connection.send_result(msg["id"], [])
|
||||||
return
|
return
|
||||||
|
|
||||||
entity_ids = msg.get("entity_ids")
|
entity_ids = msg.get("entity_ids")
|
||||||
|
@ -2391,6 +2391,7 @@ async def test_get_events_future_start_time(hass, hass_ws_client, recorder_mock)
|
|||||||
assert response["id"] == 1
|
assert response["id"] == 1
|
||||||
|
|
||||||
results = response["result"]
|
results = response["result"]
|
||||||
|
assert isinstance(results, list)
|
||||||
assert len(results) == 0
|
assert len(results) == 0
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user