Fix Adaptive mode not restoring lighting conditions
The blueprint was unconditionally overriding use_defaults to 'current', preventing modes from specifying their own use_defaults value. This caused Adaptive mode (which uses use_defaults: 'configuration') to keep the current settings instead of resetting to configuration defaults. Modified the data template to conditionally add use_defaults: 'current' only when not already present in al_config, allowing modes like Adaptive to use their specified value while maintaining backward compatibility.
This commit is contained in:
@@ -62,7 +62,12 @@ action:
|
||||
- service: adaptive_lighting.change_switch_settings
|
||||
target:
|
||||
entity_id: "{{ al_switch }}"
|
||||
data: "{{ al_config | combine({'use_defaults': 'current'}) }}"
|
||||
data: >
|
||||
{% if 'use_defaults' not in al_config %}
|
||||
{{ al_config | combine({'use_defaults': 'current'}) }}
|
||||
{% else %}
|
||||
{{ al_config }}
|
||||
{% endif %}
|
||||
|
||||
# Behavior: scene
|
||||
- conditions: "{{ behavior == 'scene' }}"
|
||||
|
||||
Reference in New Issue
Block a user