Fix interaction with hyperion on NodeMCU (#12872)

* Hyperion on NodeMCU has no 'activeEffects' entry

* Hyperion on NodeMCU has non-empty 'activeLedColor' when light is turned off
pull/12890/head
a-andre 2018-03-04 02:04:32 +01:00 committed by Paulus Schoutsen
parent cf8907ed0f
commit ba20ffdde7
1 changed files with 3 additions and 2 deletions

View File

@ -213,9 +213,10 @@ class Hyperion(Light):
except (KeyError, IndexError):
pass
if not response['info']['activeLedColor']:
led_color = response['info']['activeLedColor']
if not led_color or led_color[0]['RGB value'] == [0, 0, 0]:
# Get the active effect
if response['info']['activeEffects']:
if response['info'].get('activeEffects'):
self._rgb_color = [175, 0, 255]
self._icon = 'mdi:lava-lamp'
try: