syssi / philipslight

Xiaomi Philips Lights integration for Home Assistant
Apache License 2.0
70 stars 19 forks source link

Handle invalid color temperature #23

Closed mouth4war closed 5 years ago

mouth4war commented 5 years ago

Hi @syssi, the component throws exception when invalid color temperature is used in turn_on.

  File "/srv/homeassistant/lib/python3.6/site-packages/miio/philips_bulb.py", line 139, in set_brightness_and_color_temperature
    raise PhilipsBulbException("Invalid color temperature: %s" % cct)
miio.philips_bulb.PhilipsBulbException: Invalid color temperature: -103
syssi commented 5 years ago

This is fine for me. What do you expect?

syssi commented 5 years ago

I prefer the current behavior: Invalid values shouldn't be accepted.