-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend-alerts.yaml
52 lines (52 loc) · 1.84 KB
/
send-alerts.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# send alerts, depending on global_alert_type_test=true|false
# a real alert or a test alert will be issued
# reset pending alert flag
- if:
condition:
- lambda: 'return id(global_alert_type_test) == false;'
then:
- if:
condition:
lambda: 'return id(global_send_divera_alarm);'
then: !include
file: http-request-divera.yaml
vars:
log_text: "Sending Divera alert."
divera_type: ${divera_type}
- if:
condition:
lambda: 'return id(global_send_ntfy_alarm);'
then: !include
file: http-request-ntfy.yaml
vars:
log_text: "Sending ntfy alert."
ntfy_title: ${ntfy_title}
ntfy_priority: ${ntfy_priority}
ntfy_tags: ${ntfy_tags}
ntfy_body: ${ntfy_body}
# reset the pending (no wifi) flag
- lambda: 'id(global_alert_pending) = false;'
- lambda: 'id(global_pending_alert_type_test) = false;'
else:
# send test alerts, reset pending alert flag
- if:
condition:
lambda: 'return id(global_send_divera_testalarm);'
then: !include
file: http-request-divera.yaml
vars:
log_text: "Sending Divera test alert."
divera_type: ${divera_type}
- if:
condition:
lambda: 'return id(global_send_ntfy_testalarm);'
then: !include
file: http-request-ntfy.yaml
vars:
log_text: "Sending ntfy test alert."
ntfy_title: ${ntfy_title}
ntfy_priority: ${ntfy_priority}
ntfy_tags: ${ntfy_tags}
ntfy_body: ${ntfy_body}
- lambda: 'id(global_alert_pending) = false;'
- lambda: 'id(global_pending_alert_type_test) = false;'