diff --git a/homeassistant/components/hue/scene.py b/homeassistant/components/hue/scene.py index 7335d2a048e..d67a3b097c7 100644 --- a/homeassistant/components/hue/scene.py +++ b/homeassistant/components/hue/scene.py @@ -96,8 +96,8 @@ class HueSceneEntity(HueBaseEntity, SceneEntity): """Activate Hue scene.""" transition = kwargs.get("transition") if transition is not None: - # hue transition duration is in steps of 100 ms - transition = int(transition * 100) + # hue transition duration is in milliseconds + transition = int(transition * 1000) dynamic = kwargs.get("dynamic", self.is_dynamic) await self.bridge.async_request_call( self.controller.recall, diff --git a/homeassistant/components/hue/v2/group.py b/homeassistant/components/hue/v2/group.py index 010f7ab3382..08f1dc72325 100644 --- a/homeassistant/components/hue/v2/group.py +++ b/homeassistant/components/hue/v2/group.py @@ -150,8 +150,8 @@ class GroupedHueLight(HueBaseEntity, LightEntity): # Hue uses a range of [0, 100] to control brightness. brightness = float((brightness / 255) * 100) if transition is not None: - # hue transition duration is in steps of 100 ms - transition = int(transition * 100) + # hue transition duration is in milliseconds + transition = int(transition * 1000) # NOTE: a grouped_light can only handle turn on/off # To set other features, you'll have to control the attached lights diff --git a/homeassistant/components/hue/v2/light.py b/homeassistant/components/hue/v2/light.py index 42972f2242c..de5388e1220 100644 --- a/homeassistant/components/hue/v2/light.py +++ b/homeassistant/components/hue/v2/light.py @@ -158,8 +158,8 @@ class HueLight(HueBaseEntity, LightEntity): # Hue uses a range of [0, 100] to control brightness. brightness = float((brightness / 255) * 100) if transition is not None: - # hue transition duration is in steps of 100 ms - transition = int(transition * 100) + # hue transition duration is in milliseconds + transition = int(transition * 1000) await self.bridge.async_request_call( self.controller.set_state, @@ -176,8 +176,8 @@ class HueLight(HueBaseEntity, LightEntity): """Turn the light off.""" transition = kwargs.get(ATTR_TRANSITION) if transition is not None: - # hue transition duration is in steps of 100 ms - transition = int(transition * 100) + # hue transition duration is in milliseconds + transition = int(transition * 1000) await self.bridge.async_request_call( self.controller.set_state, id=self.resource.id, diff --git a/tests/components/hue/test_light_v2.py b/tests/components/hue/test_light_v2.py index 7843cab1574..362b7076a92 100644 --- a/tests/components/hue/test_light_v2.py +++ b/tests/components/hue/test_light_v2.py @@ -119,7 +119,7 @@ async def test_light_turn_on_service(hass, mock_bridge_v2, v2_resources_test_dat ) assert len(mock_bridge_v2.mock_requests) == 2 assert mock_bridge_v2.mock_requests[1]["json"]["on"]["on"] is True - assert mock_bridge_v2.mock_requests[1]["json"]["dynamics"]["duration"] == 600 + assert mock_bridge_v2.mock_requests[1]["json"]["dynamics"]["duration"] == 6000 async def test_light_turn_off_service(hass, mock_bridge_v2, v2_resources_test_data): @@ -164,7 +164,7 @@ async def test_light_turn_off_service(hass, mock_bridge_v2, v2_resources_test_da ) assert len(mock_bridge_v2.mock_requests) == 2 assert mock_bridge_v2.mock_requests[1]["json"]["on"]["on"] is False - assert mock_bridge_v2.mock_requests[1]["json"]["dynamics"]["duration"] == 600 + assert mock_bridge_v2.mock_requests[1]["json"]["dynamics"]["duration"] == 6000 async def test_light_added(hass, mock_bridge_v2): diff --git a/tests/components/hue/test_scene.py b/tests/components/hue/test_scene.py index 0f3d6255e86..1d270706c99 100644 --- a/tests/components/hue/test_scene.py +++ b/tests/components/hue/test_scene.py @@ -83,7 +83,7 @@ async def test_scene_turn_on_service(hass, mock_bridge_v2, v2_resources_test_dat assert len(mock_bridge_v2.mock_requests) == 2 assert mock_bridge_v2.mock_requests[1]["json"]["recall"] == { "action": "active", - "duration": 600, + "duration": 6000, }