mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Add transition support to scenes, cleanup blocking parameter (#34434)
This commit is contained in:
@@ -6,7 +6,7 @@ from homeassistant.components import light, scene
|
||||
from homeassistant.setup import async_setup_component, setup_component
|
||||
from homeassistant.util.yaml import loader as yaml_loader
|
||||
|
||||
from tests.common import get_test_home_assistant
|
||||
from tests.common import get_test_home_assistant, mock_service
|
||||
from tests.components.light import common as common_light
|
||||
from tests.components.scene import common
|
||||
|
||||
@@ -127,7 +127,19 @@ class TestScene(unittest.TestCase):
|
||||
|
||||
assert self.light_1.is_on
|
||||
assert self.light_2.is_on
|
||||
assert 100 == self.light_2.last_call("turn_on")[1].get("brightness")
|
||||
assert self.light_2.last_call("turn_on")[1].get("brightness") == 100
|
||||
|
||||
turn_on_calls = mock_service(self.hass, "light", "turn_on")
|
||||
|
||||
self.hass.services.call(
|
||||
scene.DOMAIN, "turn_on", {"transition": 42, "entity_id": "scene.test"}
|
||||
)
|
||||
self.hass.block_till_done()
|
||||
|
||||
assert len(turn_on_calls) == 1
|
||||
assert turn_on_calls[0].domain == "light"
|
||||
assert turn_on_calls[0].service == "turn_on"
|
||||
assert turn_on_calls[0].data.get("transition") == 42
|
||||
|
||||
|
||||
async def test_services_registered(hass):
|
||||
|
||||
Reference in New Issue
Block a user