-
Notifications
You must be signed in to change notification settings - Fork 15
/
xiaomi-ble.html
43 lines (40 loc) · 1.61 KB
/
xiaomi-ble.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
<script type="text/javascript">
RED.nodes.registerType('Xiaomi BLE',{
category: 'Bluetooth',
color: '#a6bbcf',
defaults: {
name: {value:""},
address: {value:"", validate:RED.validators.regex(/^$|[0-9a-fA-F][0-9a-fA-F]:[0-9a-fA-F][0-9a-fA-F]:[0-9a-fA-F][0-9a-fA-F]/) },
scanningTimeout: {value:60, validate:RED.validators.number() }
},
inputs:1,
outputs:1,
icon: "file.png",
label: function() {
return this.name||"Xiaomi BLE";
}
});
</script>
<script type="text/x-red" data-template-name="Xiaomi BLE">
<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>
<div class="form-row">
<label for="node-input-address"><i class="icon-tag"></i> Address (optional)</label>
<input type="text" id="node-input-address" placeholder="XX:XX:XX:XX:XX:XX">
</div>
<div class="form-row">
<label for="node-input-scanningTimeout"><i class="icon-tag"></i> Scanning timeout (in seconds)</label>
<input type="text" id="node-input-scanningTimeout" placeholder="60">
</div>
</script>
<script type="text/x-red" data-help-name="Xiaomi BLE">
<p>Xiaomi Bluetooth4 (BLE) sensors</p>
<p>Currently supported:</p>
<ul>
<li>MiFlora - Xiaomi Mi plant sensor</li>
<li>Xiaomi Mijia Bluetooth Temperature Humidity Sensor (MJ_HT_V1)</li>
</ul>
<p>If <code>address</code> configuration parameter is not specified then input message should have <code>msg.address</code> field.</p>
</script>