Refactor check_day_camp script to simplify value_template formatting and enhance readability
This commit is contained in:
11
scripts.yaml
11
scripts.yaml
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user