-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsignalk-send-notification.html
87 lines (78 loc) · 2.73 KB
/
signalk-send-notification.html
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<script type="text/javascript">
RED.nodes.registerType('signalk-send-notification',{
category: 'Signal K',
color: '#ffcc01',
defaults: {
name: {value:""},
path: {value: ""},
state: {value:"alarm"},
message: {value: ""},
visual: {value: true},
sound: {value: true},
source: {value: ""}
},
inputs:1,
outputs:0,
align: 'right',
icon: "bridge.png",
label: function() {
return this.name||"signalk-send-notification";
},
paletteLabel: 'send notification'
});
</script>
<script type="text/x-red" data-template-name="signalk-send-notification">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-path"><i class="icon-tag"></i> Path</label>
<input type="text" id="node-input-path" placeholder="Path">
</div>
<div class="form-row">
<label for="node-input-source"><i class="icon-tag"></i> $Source</label>
<input type="text" id="node-input-source" placeholder="$Source">
</div>
<div class="form-row">
<label for="node-input-state"><i class="icon-tag"></i> State</label>
<select id="node-input-state" placeholder="State">
<option value="normal">Normal</option>
<option value="alert">Alert</option>
<option value="warn">Warn</option>
<option value="alarm">Alarm</option>
<option value="emergency">Emergency</option>
</select>
</div>
<div class="form-row">
<label for="node-input-visual"><i class="icon-tag"></i> Visual</label>
<input type="checkbox" id="node-input-visual" placeholder="Visual">
</div>
<div class="form-row">
<label for="node-input-sound"><i class="icon-tag"></i> Sound</label>
<input type="checkbox" id="node-input-sound" placeholder="Sound">
</div>
<div class="form-row">
<label for="node-input-message"><i class="icon-tag"></i> Message</label>
<input type="text" id="node-input-message" placeholder="Message">
</div>
</script>
<script type="text/x-red" data-help-name="signalk-send-notification">
<p>Output that sends a SignalK notification</p>
<p>If the input payload is an object, then it will use the keys path, state, method, and message. Example below. Otherwise it will use the configured values.</p
<p>To specify all the info, send:</p>
<pre><code class="javascript">
{payload: {
"path":"notifications.testNotification",
"state":"alarm",
"method":["visual","sound"],
"message":"this is a notification message"
}}
</code></pre>
<p>Or to specify some of the info, send:</p>
<pre><code class="javascript">
{payload: {
"state":"normal",
}}
</code></pre>
</script>