From d90caf3e86e9e0f61707393d2c62174703c40cac Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Wed, 18 Sep 2024 21:23:05 +0200 Subject: [PATCH] Remove default transition in Matter light platform (#126220) * Remove default transition in Matter light platform * adjust test --- homeassistant/components/matter/light.py | 3 +-- tests/components/matter/test_light.py | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/matter/light.py b/homeassistant/components/matter/light.py index d334979b7c8..471e776d6be 100644 --- a/homeassistant/components/matter/light.py +++ b/homeassistant/components/matter/light.py @@ -41,7 +41,6 @@ COLOR_MODE_MAP = { clusters.ColorControl.Enums.ColorMode.kCurrentXAndCurrentY: ColorMode.XY, clusters.ColorControl.Enums.ColorMode.kColorTemperature: ColorMode.COLOR_TEMP, } -DEFAULT_TRANSITION = 0.2 # there's a bug in (at least) Espressif's implementation of light transitions # on devices based on Matter 1.0. Mark potential devices with this issue. @@ -287,7 +286,7 @@ class MatterLight(MatterEntity, LightEntity): xy_color = kwargs.get(ATTR_XY_COLOR) color_temp = kwargs.get(ATTR_COLOR_TEMP) brightness = kwargs.get(ATTR_BRIGHTNESS) - transition = kwargs.get(ATTR_TRANSITION, DEFAULT_TRANSITION) + transition = kwargs.get(ATTR_TRANSITION, 0) if self._transitions_disabled: transition = 0 diff --git a/tests/components/matter/test_light.py b/tests/components/matter/test_light.py index 4fd73b6457b..14a3a6ca97e 100644 --- a/tests/components/matter/test_light.py +++ b/tests/components/matter/test_light.py @@ -159,7 +159,7 @@ async def test_dimmable_light( endpoint_id=1, command=clusters.LevelControl.Commands.MoveToLevelWithOnOff( level=128, - transitionTime=2, + transitionTime=0, ), ) matter_client.send_device_command.reset_mock() @@ -237,7 +237,7 @@ async def test_color_temperature_light( endpoint_id=1, command=clusters.ColorControl.Commands.MoveToColorTemperature( colorTemperatureMireds=300, - transitionTime=2, + transitionTime=0, optionsMask=1, optionsOverride=1, ), @@ -348,7 +348,7 @@ async def test_extended_color_light( command=clusters.ColorControl.Commands.MoveToColor( colorX=0.5 * 65536, colorY=0.5 * 65536, - transitionTime=2, + transitionTime=0, optionsMask=1, optionsOverride=1, ), @@ -413,7 +413,7 @@ async def test_extended_color_light( command=clusters.ColorControl.Commands.MoveToHueAndSaturation( hue=167, saturation=254, - transitionTime=2, + transitionTime=0, optionsMask=1, optionsOverride=1, ),