Handle service calls that do not refer entity IDs (#31317)

pull/31320/head
Paulus Schoutsen 2020-01-30 09:28:06 -08:00 committed by GitHub
parent 24f4f53f16
commit d24e397a80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -201,6 +201,10 @@ class Script:
continue
entity_ids = data.get(ATTR_ENTITY_ID)
if entity_ids is None:
continue
if isinstance(entity_ids, str):
entity_ids = [entity_ids]

View File

@ -1043,6 +1043,7 @@ async def test_referenced_entities():
"entity_id": "sensor.condition",
"state": "100",
},
{"service": "test.script", "data": {"without": "entity_id"}},
{"scene": "scene.hello"},
{"event": "test_event"},
{"delay": "{{ delay_period }}"},