forked from thevalyreangroup/node-red-contrib-ringdoorbell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathringdoorbell-node.html
executable file
·53 lines (49 loc) · 2.07 KB
/
ringdoorbell-node.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
<script type="text/x-red" data-template-name="ring doorbell">
<div class="form-row">
<label for="node-input-token">Token</label>
<input type="text" id="node-input-token">
</div>
<div class="form-row">
<label for="node-input-topic"><i class="fa fa-tasks"></i> Topic</label>
<input type="text" id="node-input-topic" placeholder="Topic">
</div>
<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>
</script>
<!-- Next, some simple help text is provided for the node. -->
<script type="text/x-red" data-help-name="ring doorbell">
<p>
A node for node-red that uses the unofficial ring-api package.
</p>
<p>
Outputs an object called <b>msg</b> containing all the device ringactivity in <b>msg.payload</b>
The <b>msg.topic</b> can be set in the nodes configuration
or it will default to the node name or "ring doorbell".
</p>
</script>
<!-- Finally, the node type is registered along with all of its properties -->
<!-- The example below shows a small subset of the properties that can be set-->
<script type="text/javascript">
RED.nodes.registerType('ring doorbell',{
category: 'input', // the palette category
defaults: { // defines the editable properties of the node
token: {value:""},
testmode: {value:"N"},
verbose: {value:"N"},
topic: {value:""},
name: {value:""}
},
color:"#ef6530",
inputs:0, // set the number of inputs - only 0 or 1
outputs:1, // set the number of outputs - 0 to n
icon: "bridge.png", //"white-globe.png", // set the icon (held in public/icons)
label: function() { // sets the default label contents
return this.name||"ring doorbell";
},
labelStyle: function() { // sets the class to apply to the label
return this.name ? "" : "node_label_italic";
}
});
</script>