-
Notifications
You must be signed in to change notification settings - Fork 8
/
bme280.html
65 lines (57 loc) · 2.12 KB
/
bme280.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
<script type="text/x-red" data-template-name="Bme280">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" />
</div>
<div class="form-row">
<label for="node-input-bus"><i class="fa fa-microchip"></i> Bus #</label>
<input type="text" id="node-input-bus" />
</div>
<div class="form-row">
<label for="node-input-address"><i class="fa fa-microchip"></i> I2C Address</label>
<input type="text" id="node-input-address" />
</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">
</div>
<div class="form-row">
<label for="node-input-extra"><i class="fa fa-check"></i> Extra Data</label>
<input type="checkbox" id="node-input-extra" style="width: 60%;" />
</div>
<div class="form-row">
<label for="node-input-preasure"><i class="fa fa-tag"></i> Sea Preasure</label>
<input type="text" id="node-input-preasure">
</div>
</script>
<script type="text/javascript">
RED.nodes.registerType("Bme280", {
category: "input",
color:"#E6E0F8",
icon:"bme280.png",
defaults: {
name: {value:"", required: false},
bus: {value:"1", required: true, validate: RED.validators.number() },
address: {value: "0x76", required:true, validate: function(v) {
var n=parseInt(v,16);
return v.length==4 && v[0]=="0" && v[1].toUpperCase()=="X" && !isNaN(n) &&
n>=0x10 && n<0x78;
}},
topic: { value:'bme280', required:false },
extra: { value:false, required: true},
preasure:{ value:1013.25, required: false, validate: RED.validators.number() }
},
outputs:1,
inputs:1,
label: function() {
return this.name ? this.name : "Bme280";
},
labelStyle: function() { return this.name ? "node_label_italic" : "";},
outputLabels: ["Sensor reads"],
inputLabels: ["Trigger"]
});
</script>
<script type="text/x-red" data-help-name="Bme280">
<p> Read environmental data from BME280/BMP280 I2C sensors</p>
<p> TODO </p>
</script>