Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use default brightness/colortemp in sleep mode if not configured #50

Open
claytonjn opened this issue Oct 21, 2019 · 1 comment
Open
Labels
bug Something isn't working

Comments

@claytonjn
Copy link
Owner

If user omits sleep_colortemp the non-sleep calculated colortemp should be used. If user omits sleep_brightness the non-sleep calculated brightness should be used. If user omits both, both non-sleep values should be used (resulting in "sleep" mode being the same as "regular" mode).

@claytonjn claytonjn added the bug Something isn't working label Oct 21, 2019
@Alfiegerner
Copy link

Just to add to this - not setting sleep_colortemp but setting sleep_brightness causes following exception log spamming:

2020-07-28 21:06:47 ERROR (SyncWorker_5) [homeassistant.util.logging] Exception in update_switch when dispatching 'circadian_lighting_update': ()
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/custom_components/circadian_lighting/switch.py", line 258, in update_switch
    self._hs_color = self.calc_hs()
  File "/home/homeassistant/.homeassistant/custom_components/circadian_lighting/switch.py", line 241, in calc_hs
    return color_xy_to_hs(*self.calc_xy())
  File "/home/homeassistant/.homeassistant/custom_components/circadian_lighting/switch.py", line 238, in calc_xy
    return color_RGB_to_xy(*self.calc_rgb())
  File "/home/homeassistant/.homeassistant/custom_components/circadian_lighting/switch.py", line 233, in calc_rgb
    return color_temperature_to_rgb(self._sleep_colortemp)
  File "/srv/homeassistant/lib/python3.8/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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants