-
Notifications
You must be signed in to change notification settings - Fork 0
/
energymeter.html
66 lines (60 loc) · 2.24 KB
/
energymeter.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
<script type="text/javascript">
RED.nodes.registerType('energyMeter',{
category: 'function',
color: '#a6bbcf',
defaults: {
name: {value:""},
topic: {value: ""},
inputformat: {value:"w"},
accuracy: {value:"100"},
price: {value: "", validate:function(val) {
return (val > 1 || val === 0.0 || val === "")
}
}
},
inputs: 1,
outputs: 1,
icon: "power.png",
oneditsave: function () {
var node = this;
},
label: function() {
return this.name||"energyMeter";
}
});
</script>
<script type="text/html" data-template-name="energyMeter">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-topic"><i class="fa fa-tag"></i> Topic</label>
<input type="text" id="node-input-topic" placeholder="Topic">
</div>
<div class="form-row">
<label for="node-input-inputformat"><i class="fa fa-arrow-right"></i> Input power format</label>
<select id="node-input-inputformat">
<option value="w">watt</option>
<option value="kw">kw</option>
<option value="mw">megawatt</option>
</select>
</div>
<div class="form-row">
<div class="form-tips"><b>Info:</b> Define the number of decimal places for energy calculation.</div>
<label for="node-input-accuracy"><i class="fa fa-terminal"></i> Decimal places</label>
<select id="node-input-accuracy">
<option value="1">0</option>
<option value="10">1</option>
<option value="100">2</option>
<option value="1000">3</option>
</select>
</div>
<div class="form-row">
<label for="node-input-price"><i class="fa fa-tag"></i> Price ct/kwh</label>
<input type="float" id="node-input-price" placeholder="ct/kwh">
</div>
</script>
<script type="text/html" data-help-name="energyMeter">
<p>A simple node that converts the message payloads into all lower-case characters</p>
</script>