-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.html
More file actions
42 lines (41 loc) · 1.14 KB
/
node.html
File metadata and controls
42 lines (41 loc) · 1.14 KB
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
<script type="text/javascript">
// noinspection JSCheckFunctionSignatures
/**
* @namespace {import('node-red__registry')}
* @member {NodeAPI} RED
*/
RED.nodes.registerType('mihome-node', {
category: 'mihome',
color: '#00BC9C',
defaults: {
// Mi Home settings node
cloud: { value: null, type: 'mihome-cloud' },
// Add additional settings for node
name: { value: '' },
},
icon: 'mihome.png',
inputs: 1,
outputs: 1,
label: () => {
if (this.name.length > 0) {
return this.name;
}
return 'Node';
},
});
</script>
<script type="text/html" data-template-name="mihome-node">
<!-- Mi Home settings node field -->
<div class="form-row">
<label for="node-input-cloud"><i class="fa fa-cloud"></i> Cloud</label>
<input id="node-input-cloud" />
</div>
<!-- Add additional fields to setup node settings -->
<div class="form-row">
<label for="node-input-name"><i class="fa fa-pencil"></i> Name</label>
<input type="text" id="node-input-name" />
</div>
</script>
<script type="text/html" data-help-name="mihome-node">
<p>Add some help text</p>
</script>