diff --git a/homeassistant/components/light/flux_led.py b/homeassistant/components/light/flux_led.py index 13a52fcb1a1..b3aa7e59901 100644 --- a/homeassistant/components/light/flux_led.py +++ b/homeassistant/components/light/flux_led.py @@ -7,9 +7,11 @@ https://home-assistant.io/components/light.flux_led/ import logging import socket +import random import voluptuous as vol from homeassistant.components.light import (ATTR_BRIGHTNESS, ATTR_RGB_COLOR, + ATTR_EFFECT, EFFECT_RANDOM, SUPPORT_BRIGHTNESS, SUPPORT_RGB_COLOR, Light) import homeassistant.helpers.config_validation as cv @@ -125,10 +127,15 @@ class FluxLight(Light): rgb = kwargs.get(ATTR_RGB_COLOR) brightness = kwargs.get(ATTR_BRIGHTNESS) + effect = kwargs.get(ATTR_EFFECT) if rgb: self._bulb.setRgb(*tuple(rgb)) elif brightness: self._bulb.setWarmWhite255(brightness) + elif effect == EFFECT_RANDOM: + self._bulb.setRgb(random.randrange(0, 255), + random.randrange(0, 255), + random.randrange(0, 255)) def turn_off(self, **kwargs): """Turn the specified or all lights off."""