hass-circadian_lighting icon indicating copy to clipboard operation
hass-circadian_lighting copied to clipboard

Move to single switch and UI configurable (preparation for PR into homeassistant/core)

Open basnijholt opened this issue 3 years ago • 7 comments

Just leaving this here for feedback.

Inspired by #114, I have heavily simplified the setup. Now it's just a single switch that can take all of the settings.

I plan to add this to core soon, as a replacement for Flux.

P.S., don't mind the name switching from Circadian -> Adaptive, I just did a find + replace all to have the original circadian_lighting and this code side by side in my config.

TODO:

  • [ ] make it work well with groups
  • [x] set all the correct UI elements
  • [x] integrate the config_validation option parsing
  • [x] respond to events instead of state changes, then don't do anything on HA restart

basnijholt avatar Sep 12 '20 10:09 basnijholt

This is how the setup looks in the UI: image

basnijholt avatar Sep 12 '20 21:09 basnijholt

while you're still busy doing awesome work, i noticed you added a sunset_time and sunrise_time. I assume this overrides the sunset/sunrise times for the configured location.

I was wondering, is it much work to also add (or change it into) a min_sunset_time and max_sunrise_time ? So the lights will be on longer if the days are longer, but with long nights it will keep a certain minimum day?

ChessSpider avatar Sep 12 '20 21:09 ChessSpider

while you're still busy doing awesome work, i noticed you added a sunset_time and sunrise_time. I assume this overrides the sunset/sunrise times for the configured location.

I was wondering, is it much work to also add (or change it into) a min_sunset_time and max_sunrise_time ? So the lights will be on longer if the days are longer, but with long nights it will keep a certain minimum day?

Please create an issue for this request, thanks!

claytonjn avatar Sep 13 '20 15:09 claytonjn

@basnijholt Another busy weekend for me so I haven't had the chance to even look over the commits yet. Does this still allow for toggling CL on/off for different sets of lights at different times?

claytonjn avatar Sep 13 '20 15:09 claytonjn

@claytonjn, yes, one is still able to do everything that the integration could do before. Here all the settings just go to the switch.

basnijholt avatar Sep 14 '20 20:09 basnijholt

Pretty cool new change, I removed lights_brightness, lights_mired, lights_rgb, lights_xy. Now it's just lights and the integration will figure out what a light supports.

basnijholt avatar Sep 15 '20 19:09 basnijholt

@ChessSpider, @pixeye33, @forstermatth (ppl who liked this PR), I have now submitted this code to the home-assistant/core repo: https://github.com/home-assistant/core/pull/40626 :tada:

basnijholt avatar Sep 26 '20 15:09 basnijholt