basnijholt / adaptive-lighting

Adaptive Lighting custom component for Home Assistant
https://basnijholt.github.io/adaptive-lighting/
Apache License 2.0
1.86k stars 135 forks source link

Feature Request: Save Switch Settings Service #724

Open zpriddy opened 1 year ago

zpriddy commented 1 year ago

I currently have a HA script that runs over all the adaptive lighting switches and runs adaptive_lighting.change_switch_settings over each of them to keep them all synchronized. However on reload it will load the configuration that it shows in the UI for each switch...

It would be nice to have another service adaptive_lighting.save_switch_settings that could be run that would save the current switch settings to the configuration so that each time the service is reloaded or HA is restarted it would keep the settings that have been set.

th3w1zard1 commented 1 year ago

Couldn't you use templates and helpers to store the information used? the include_config_in_attributes bool makes this easy as well.

zpriddy commented 9 months ago

But it would be helpful to save the current config as the config on reboot.. this way if you have multiple adaptive lighting entries.. you an update them all with a service call..

th3w1zard1 commented 7 months ago

But it would be helpful to save the current config as the config on reboot.. this way if you have multiple adaptive lighting entries.. you an update them all with a service call..

But this could already be done with an automation/script. Once your first script saves the contents of include_config_in_attributes you can call another one that'll load it and call the change_switch_settings with the contents. Most if not all arguments could directly be passed through.