Refactor check_day_camp script to improve formatting and maintain consistency
This commit is contained in:
42
scripts.yaml
42
scripts.yaml
@@ -1,21 +1,21 @@
|
||||
check_day_camp:
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: >
|
||||
{{ states('calendar.family_events') == 'on' and
|
||||
'camp' in (state_attr('calendar.family_events', 'message') | default('') | lower) and
|
||||
'no' not in (state_attr('calendar.family_events', 'message') | default('') | lower) }}
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.day_camp_today
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.day_camp_today
|
||||
- service: system_log.write
|
||||
data:
|
||||
message: "Calendar Check: State={{ states('calendar.family_events') }}, Message={{ state_attr('calendar.family_events', 'message') | default('') }}"
|
||||
level: debug
|
||||
- check_day_camp:
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: template
|
||||
value_template: >
|
||||
{{ states('calendar.family_events') == 'on' and
|
||||
'camp' in (state_attr('calendar.family_events', 'message') | default('') | lower) and
|
||||
'no' not in (state_attr('calendar.family_events', 'message') | default('') | lower) }}
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.day_camp_today
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.day_camp_today
|
||||
- service: system_log.write
|
||||
data:
|
||||
message: "Calendar Check: State={{ states('calendar.family_events') }}, Message={{ state_attr('calendar.family_events', 'message') | default('') }}"
|
||||
level: debug
|
||||
Reference in New Issue
Block a user