mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Fix turning on the light with a specific color (#108080)
This commit is contained in:
parent
5cc1a761dd
commit
52acc4bbab
@ -89,6 +89,10 @@ class MatterLight(MatterEntity, LightEntity):
|
|||||||
colorY=int(matter_xy[1]),
|
colorY=int(matter_xy[1]),
|
||||||
# It's required in TLV. We don't implement transition time yet.
|
# It's required in TLV. We don't implement transition time yet.
|
||||||
transitionTime=0,
|
transitionTime=0,
|
||||||
|
# allow setting the color while the light is off,
|
||||||
|
# by setting the optionsMask to 1 (=ExecuteIfOff)
|
||||||
|
optionsMask=1,
|
||||||
|
optionsOverride=1,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -103,6 +107,10 @@ class MatterLight(MatterEntity, LightEntity):
|
|||||||
saturation=int(matter_hs[1]),
|
saturation=int(matter_hs[1]),
|
||||||
# It's required in TLV. We don't implement transition time yet.
|
# It's required in TLV. We don't implement transition time yet.
|
||||||
transitionTime=0,
|
transitionTime=0,
|
||||||
|
# allow setting the color while the light is off,
|
||||||
|
# by setting the optionsMask to 1 (=ExecuteIfOff)
|
||||||
|
optionsMask=1,
|
||||||
|
optionsOverride=1,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -114,6 +122,10 @@ class MatterLight(MatterEntity, LightEntity):
|
|||||||
colorTemperatureMireds=color_temp,
|
colorTemperatureMireds=color_temp,
|
||||||
# It's required in TLV. We don't implement transition time yet.
|
# It's required in TLV. We don't implement transition time yet.
|
||||||
transitionTime=0,
|
transitionTime=0,
|
||||||
|
# allow setting the color while the light is off,
|
||||||
|
# by setting the optionsMask to 1 (=ExecuteIfOff)
|
||||||
|
optionsMask=1,
|
||||||
|
optionsOverride=1,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -202,6 +202,8 @@ async def test_color_temperature_light(
|
|||||||
command=clusters.ColorControl.Commands.MoveToColorTemperature(
|
command=clusters.ColorControl.Commands.MoveToColorTemperature(
|
||||||
colorTemperatureMireds=300,
|
colorTemperatureMireds=300,
|
||||||
transitionTime=0,
|
transitionTime=0,
|
||||||
|
optionsMask=1,
|
||||||
|
optionsOverride=1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
call(
|
call(
|
||||||
@ -278,7 +280,11 @@ async def test_extended_color_light(
|
|||||||
node_id=light_node.node_id,
|
node_id=light_node.node_id,
|
||||||
endpoint_id=1,
|
endpoint_id=1,
|
||||||
command=clusters.ColorControl.Commands.MoveToColor(
|
command=clusters.ColorControl.Commands.MoveToColor(
|
||||||
colorX=0.5 * 65536, colorY=0.5 * 65536, transitionTime=0
|
colorX=0.5 * 65536,
|
||||||
|
colorY=0.5 * 65536,
|
||||||
|
transitionTime=0,
|
||||||
|
optionsMask=1,
|
||||||
|
optionsOverride=1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
call(
|
call(
|
||||||
@ -311,8 +317,8 @@ async def test_extended_color_light(
|
|||||||
hue=167,
|
hue=167,
|
||||||
saturation=254,
|
saturation=254,
|
||||||
transitionTime=0,
|
transitionTime=0,
|
||||||
optionsMask=0,
|
optionsMask=1,
|
||||||
optionsOverride=0,
|
optionsOverride=1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
call(
|
call(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user