Make sure empty get_events results is always a list (#72021)
This commit is contained in:
parent
8f4caf4141
commit
5433c0a535
2 changed files with 2 additions and 1 deletions
|
@ -271,7 +271,7 @@ async def ws_get_events(
|
|||
return
|
||||
|
||||
if start_time > utc_now:
|
||||
connection.send_result(msg["id"], {})
|
||||
connection.send_result(msg["id"], [])
|
||||
return
|
||||
|
||||
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
|
||||
|
||||
results = response["result"]
|
||||
assert isinstance(results, list)
|
||||
assert len(results) == 0
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue