Add support for exposing light effects via Google Assistant (#38575)
* Don't set SUPPORT_EFFECT on DemoLight if there are no effects This requires an update to the group test - previously the other lights instantiated by the DemoLight component had nothing in ATTR_EFFECT_LIST, but still had SUPPORT_EFFECT set. This appears to have resulted in the light group test code setting an effect on the group and expecting it to apply to all lights, but given that two of the bulbs didn't actually support any effects (due to the empty ATTR_EFFECT_LIST) this seems like a broken assumption and updating the test to verify only the bulb that supports effects has had one applied seems reasonable. * Add support for exposing light effects via Google Assistant The LightEffects trait only supports a fixed (and small) list of lighting effects, but we can expose them via the Modes trait - this requires saying "Set (foo) effect to (bar)" which is a little clumsy, but at least makes it possible.
This commit is contained in:
1 parent
e304792f3a
commit
34e2a1825b
6 files changed
+208
-13
No files matched your search
@@ -545,13 +545,11 @@ async def test_service_calls(hass):
|
||||
state = hass.states.get("light.ceiling_lights")
|
||||
assert state.state == STATE_ON
|
||||
assert state.attributes[ATTR_BRIGHTNESS] == 128
|
||||
assert state.attributes[ATTR_EFFECT] == "Random"
|
||||
assert state.attributes[ATTR_RGB_COLOR] == (42, 255, 255)
|
||||
|
||||
state = hass.states.get("light.kitchen_lights")
|
||||
assert state.state == STATE_ON
|
||||
assert state.attributes[ATTR_BRIGHTNESS] == 128
|
||||
assert state.attributes[ATTR_EFFECT] == "Random"
|
||||
assert state.attributes[ATTR_RGB_COLOR] == (42, 255, 255)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user