happyleavesaoc / python-limitlessled

MIT License
33 stars 22 forks source link

Transition from white to color fails for RGBW groups. #11

Closed janLo closed 7 years ago

janLo commented 7 years ago

The RGBW group set the target color to None if there is a transition from RGB_WHITE (https://github.com/happyleavesaoc/python-limitlessled/blob/master/limitlessled/group/rgbw.py#L117). It then calls hue_of_color(color) (https://github.com/happyleavesaoc/python-limitlessled/blob/master/limitlessled/group/rgbw.py#L129) which causes a TypeError: 'NoneType' object is not iterable:

Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
    self.run()
  File "/home/hass/.homeassistant/deps/limitlessled/pipeline.py", line 32, in run
    self._queue.get().run(self._event)
  File "/home/hass/.homeassistant/deps/limitlessled/pipeline.py", line 109, in run
    self._execute_stage(i, stage, stop)
  File "/home/hass/.homeassistant/deps/limitlessled/pipeline.py", line 167, in _execute_stage
    self._group.transition(*stage.args, **stage.kwargs)
  File "/home/hass/.homeassistant/deps/limitlessled/group/rgbw.py", line 129, in transition
    self._transition(duration, hue_of_color(color), brightness)
  File "/home/hass/.homeassistant/deps/limitlessled/util.py", line 15, in hue_of_color
    return rgb_to_hsv(*[x / 255 for x in color])[0]
TypeError: 'NoneType' object is not iterable