Make sure empty get_events results is always a list (#72021)

This commit is contained in:
Paulus Schoutsen 2022-05-17 10:43:58 -07:00 committed by GitHub
parent 8f4caf4141
commit 5433c0a535
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -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")

View file

@ -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