Rewrote text_notify to properly deal with notifications being off #42
This commit is contained in:
@ -263,66 +263,80 @@ script:
|
||||
- condition: state
|
||||
entity_id: input_boolean.text_notifications
|
||||
state: 'on'
|
||||
- choose:
|
||||
- conditions:
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: '{{ who == "tony"}}'
|
||||
then:
|
||||
- if:
|
||||
- condition: state
|
||||
entity_id: input_boolean.text_notify_tony
|
||||
state: 'on'
|
||||
sequence:
|
||||
then:
|
||||
- service: notify.ios_tony
|
||||
data:
|
||||
title: '{{ title }}'
|
||||
message: '{{ message }}'
|
||||
- conditions:
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: '{{ who == "tina"}}'
|
||||
then:
|
||||
- if:
|
||||
- condition: state
|
||||
entity_id: input_boolean.text_notify_tina
|
||||
state: 'on'
|
||||
sequence:
|
||||
then:
|
||||
- service: notify.ios_tina
|
||||
data:
|
||||
title: '{{ title }}'
|
||||
message: '{{ message }}'
|
||||
- conditions:
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: '{{ who == "kallen"}}'
|
||||
then:
|
||||
- if:
|
||||
- condition: state
|
||||
entity_id: input_boolean.text_notify_kallen
|
||||
state: 'on'
|
||||
sequence:
|
||||
then:
|
||||
- service: notify.ios_kallen
|
||||
data:
|
||||
title: '{{ title }}'
|
||||
message: '{{ message }}'
|
||||
- conditions:
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: '{{ who == "parents"}}'
|
||||
then:
|
||||
- if:
|
||||
- condition: state
|
||||
entity_id: input_boolean.text_notify_parents
|
||||
state: 'on'
|
||||
sequence:
|
||||
then:
|
||||
- service: notify.ios_parents
|
||||
data:
|
||||
title: '{{ title }}'
|
||||
message: '{{ message }}'
|
||||
- conditions:
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: '{{ who == "nerds"}}'
|
||||
then:
|
||||
- if:
|
||||
- condition: state
|
||||
entity_id: input_boolean.text_notify_nerds
|
||||
state: 'on'
|
||||
sequence:
|
||||
then:
|
||||
- service: notify.ios_nerds
|
||||
data:
|
||||
title: '{{ title }}'
|
||||
message: '{{ message }}'
|
||||
default:
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: '{{ who == "all"}}'
|
||||
then:
|
||||
- if:
|
||||
- condition: state
|
||||
entity_id: input_boolean.text_notify_all
|
||||
state: 'on'
|
||||
then:
|
||||
- service: notify.all_ios
|
||||
data:
|
||||
title: '{{ title }}'
|
||||
|
Reference in New Issue
Block a user