hass-circadian_lighting
hass-circadian_lighting copied to clipboard
TypeError: '<' not supported between instances of 'NoneType' and 'int'
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/custom_components/circadian_lighting/switch.py", line 245, in update_switch
self._hs_color = self.calc_hs()
File "/home/homeassistant/.homeassistant/custom_components/circadian_lighting/switch.py", line 228, in calc_hs
return color_xy_to_hs(*self.calc_xy())
File "/home/homeassistant/.homeassistant/custom_components/circadian_lighting/switch.py", line 225, in calc_xy
return color_RGB_to_xy(*self.calc_rgb())
File "/home/homeassistant/.homeassistant/custom_components/circadian_lighting/switch.py", line 220, in calc_rgb
return color_temperature_to_rgb(self._attributes['sleep_colortemp'])
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/util/color.py", line 453, in color_temperature_to_rgb
if color_temperature_kelvin < 1000:
TypeError: '<' not supported between instances of 'NoneType' and 'int'
Got this when turning CL switch on.
One of the lights_ct was offline, if it means anything.
Config:
name: Living Room
lights_xy:
- light.console_backlight
lights_ct:
- light.floor_lamp
- light.living_wall_lamps
# disable_entity: media_player.living_room_media_player
# disable_state: 'on'
sleep_entity: sensor.living_avr_source
sleep_state: 'Shield'
# sleep_colortemp: 4100
sleep_brightness: 1
# disable_brightness_adjust: True
It's because it's trying to set based on sleep mode but doesn't know what color temperature to use because you commented it out.
Unfortunately the configuration validation doesn't have a way (that I know of) for conditional requirements (i.e. if sleep_entity
is defined, all sleep_XXX
options must be set).
I suppose I could write my own logic to check for this, throw a more descriptive error, and not try to utilize sleep mode if not properly configured.
Yup, that fixed it. Feel free to close or keep it open if you want to keep track of config validation improvements.
I'll keep it open, thanks for reporting!
Thanks for keeping this open - this bug bit me as well, and I was able to fix my issue by defining the missing sleep variables. +1 for the config logic checker.
+1
I was going to open a new issue and then this showed up in the search.
@claytonjn - I don't know if you've considered how to address lights that are only brightness adjustable. I made a few groups with only lights_brightness
but it seems like this value was still required.
I just ran into this issue as well. At the very least could the Wiki be updated to state that all sleep settings have to be configured for it to work?