1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Do not select all entities when omitting entity ID in service call (#29178)

* Do not select all entities when omitting entity ID

* Address comments Matthew

* Require either area_id or entity_id

* Fix tests

* Fix test
This commit is contained in:
Paulus Schoutsen
2019-12-02 16:23:12 -08:00
committed by GitHub
parent 9587afc5ce
commit 02d9ed5e36
47 changed files with 538 additions and 626 deletions

View File

@@ -62,10 +62,14 @@ async def test_turn_off(hass):
async def test_turn_off_without_entity_id(hass):
"""Test light turn off all lights."""
await hass.services.async_call("light", "turn_on", {}, blocking=True)
await hass.services.async_call(
"light", "turn_on", {"entity_id": "all"}, blocking=True
)
assert light.is_on(hass, ENTITY_LIGHT)
await hass.services.async_call("light", "turn_off", {}, blocking=True)
await hass.services.async_call(
"light", "turn_off", {"entity_id": "all"}, blocking=True
)
assert not light.is_on(hass, ENTITY_LIGHT)