Add color_mode support to group light (#50165)

* Add color_mode support to group light

* Lint

* Update tests
This commit is contained in:
Erik Montnemery 2021-05-07 07:34:51 +02:00 committed by GitHub
parent 47c4c681f4
commit c2663d61d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 610 additions and 134 deletions

View file

@ -36,18 +36,33 @@ async def async_setup_platform(
class MockLight(MockToggleEntity, LightEntity):
"""Mock light class."""
brightness = None
color_mode = None
max_mireds = 500
min_mireds = 153
supported_color_modes = None
supported_features = 0
color_mode = None
brightness = None
color_temp = None
hs_color = None
xy_color = None
rgb_color = None
rgbw_color = None
rgbww_color = None
color_temp = None
xy_color = None
white_value = None
def turn_on(self, **kwargs):
"""Turn the entity on."""
super().turn_on(**kwargs)
for key, value in kwargs.items():
if key in [
"brightness",
"hs_color",
"xy_color",
"rgb_color",
"rgbw_color",
"rgbww_color",
"color_temp",
"white_value",
]:
setattr(self, key, value)