Refactor check_day_camp script to simplify value_template formatting and enhance readability

This commit is contained in:
2025-06-25 15:47:47 -04:00
parent 4eecbe4589
commit 5e9cf011af

View File

@@ -5,13 +5,10 @@ check_day_camp:
- conditions: - conditions:
- condition: template - condition: template
value_template: >- value_template: >-
{{ states('calendar.family_events') == 'on' value_template: >
and 'camp' in (state_attr('calendar.family_events', 'message') {{ states('calendar.family_events') == 'on' and
| default('') 'camp' in (state_attr('calendar.family_events', 'message') | lower) and
| lower) 'no' not in (state_attr('calendar.family_events', 'message') | lower) }}
and 'no' not in (state_attr('calendar.family_events', 'message')
| default('')
| lower) }}
sequence: sequence:
- service: input_boolean.turn_on - service: input_boolean.turn_on
target: target: