From ec490070ca70c4be13f959a3c1f6fceee0c24132 Mon Sep 17 00:00:00 2001 From: Anders Melchiorsen Date: Wed, 26 Apr 2017 22:51:33 +0200 Subject: [PATCH] LIFX: Move random hue initial color to the LIFXEffect base class It's a reasonable default for several light effects. --- homeassistant/components/light/lifx/effects.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/homeassistant/components/light/lifx/effects.py b/homeassistant/components/light/lifx/effects.py index 1259d463e0e..2dc56443723 100644 --- a/homeassistant/components/light/lifx/effects.py +++ b/homeassistant/components/light/lifx/effects.py @@ -213,7 +213,7 @@ class LIFXEffect(object): def from_poweroff_hsbk(self, light, **kwargs): """Return the color when starting from a powered off state.""" - return None + return [random.randint(0, 65535), 65535, 0, NEUTRAL_WHITE] class LIFXEffectBreathe(LIFXEffect): @@ -326,10 +326,6 @@ class LIFXEffectColorloop(LIFXEffect): yield from asyncio.sleep(period) - def from_poweroff_hsbk(self, light, **kwargs): - """Start from a random hue.""" - return [random.randint(0, 65535), 65535, 0, NEUTRAL_WHITE] - class LIFXEffectStop(LIFXEffect): """A no-op effect, but starting it will stop an existing effect."""