Add color_mode to demo light (#49694)

* Update demo light with color mode support

* Add rgbw and rgbww color properties

* Update demo light

* Tweak

* Remove unneeded _clear_colors
This commit is contained in:
Erik Montnemery 2021-04-29 10:45:17 +02:00 committed by GitHub
parent 25d257b631
commit bf57c77d5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 118 additions and 51 deletions

View file

@ -11,7 +11,6 @@ from homeassistant.components.light import (
ATTR_MAX_MIREDS,
ATTR_MIN_MIREDS,
ATTR_RGB_COLOR,
ATTR_WHITE_VALUE,
ATTR_XY_COLOR,
DOMAIN as LIGHT_DOMAIN,
SERVICE_TURN_OFF,
@ -54,13 +53,11 @@ async def test_state_attributes(hass):
{
ATTR_ENTITY_ID: ENTITY_LIGHT,
ATTR_RGB_COLOR: (251, 253, 255),
ATTR_WHITE_VALUE: 254,
},
blocking=True,
)
state = hass.states.get(ENTITY_LIGHT)
assert state.attributes.get(ATTR_WHITE_VALUE) == 254
assert state.attributes.get(ATTR_RGB_COLOR) == (250, 252, 255)
assert state.attributes.get(ATTR_XY_COLOR) == (0.319, 0.326)