-
Notifications
You must be signed in to change notification settings - Fork 7
/
ringdoorbell-node.html
executable file
·62 lines (58 loc) · 2.55 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
54
55
56
57
58
59
60
61
62
<script type="text/x-red" data-template-name="ring doorbell">
<div class="form-row">
<label for="node-config-input-email">Email</label>
<input type="text" id="node-input-email">
</div>
<div class="form-row">
<label for="node-input-password">Password</label>
<input type="text" id="node-input-password">
</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>
<!-- By convention, most nodes have a 'name' property. The following div -->
<!-- provides the necessary field. -->
<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
testmode: {value:"N"},
verbose: {value:"N"},
topic: {value:""},
name: {value:""}
},
credentials: {
email: {type: "text"}, // {value:"", required: true}, // along with default values.
password: {type: "text"} // {value:"", required:true}
},
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>