node-red-contrib-periph-humidity 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -18,6 +18,9 @@ npm install node-red-contrib-periph-humidity
18
18
  |------|------|-------------|
19
19
  | `dht11-device` | config | Bus configuration for a DHT11 |
20
20
  | `dht11` | input | Reads temperature and humidity from a DHT11 sensor over a single GPIO data line. |
21
+ | `periph-htu21df` | input | Reads temperature and relative humidity from a Measurement Specialties HTU21D-F over I²C (fixed address 0x40) with one temperature and one humidity measurement per message. The CRC of both results is verified. |
22
+ | `periph-sht31` | input | Reads temperature and relative humidity from a Sensirion SHT31 over I²C (0x44 with ADDR low, 0x45 with ADDR high) with one single-shot measurement per message. Both CRC bytes are verified. |
23
+ | `periph-si7021` | input | Reads relative humidity and temperature from a Silicon Labs Si7021 over I²C (fixed address 0x40) with one relative-humidity measurement per message; the temperature comes from the same conversion. The CRC of the humidity result is verified. |
21
24
 
22
25
  ## Links
23
26
 
@@ -0,0 +1,86 @@
1
+ [
2
+ {
3
+ "id": "htu21df-tab",
4
+ "type": "tab",
5
+ "label": "HTU21D-F humidity logger",
6
+ "disabled": false,
7
+ "info": "Reads temperature and relative humidity from an HTU21D-F every 2 s and formats them. Demonstrates the no-hold-master temperature and humidity measurements with CRC checking."
8
+ },
9
+ {
10
+ "id": "htu21df-inject",
11
+ "type": "inject",
12
+ "z": "htu21df-tab",
13
+ "name": "2 s timer",
14
+ "props": [
15
+ {
16
+ "p": "payload"
17
+ }
18
+ ],
19
+ "repeat": "2",
20
+ "crontab": "",
21
+ "once": false,
22
+ "onceDelay": 0.1,
23
+ "topic": "",
24
+ "payloadType": "date",
25
+ "x": 160,
26
+ "y": 160,
27
+ "wires": [
28
+ [
29
+ "htu21df-node"
30
+ ]
31
+ ]
32
+ },
33
+ {
34
+ "id": "htu21df-node",
35
+ "type": "periph-htu21df",
36
+ "z": "htu21df-tab",
37
+ "name": "HTU21D-F",
38
+ "bus": "1",
39
+ "address": "0x40",
40
+ "x": 380,
41
+ "y": 160,
42
+ "wires": [
43
+ [
44
+ "htu21df-format"
45
+ ]
46
+ ],
47
+ "resolution": "12/14",
48
+ "heater": false
49
+ },
50
+ {
51
+ "id": "htu21df-format",
52
+ "type": "function",
53
+ "z": "htu21df-tab",
54
+ "name": "Format",
55
+ "func": "msg.payload = msg.payload.temperature_c.toFixed(2) + ' °C, ' + msg.payload.humidity_pct.toFixed(1) + ' %RH';\nreturn msg;",
56
+ "outputs": 1,
57
+ "noerr": 0,
58
+ "initialize": "",
59
+ "finalize": "",
60
+ "libs": [],
61
+ "x": 600,
62
+ "y": 160,
63
+ "wires": [
64
+ [
65
+ "htu21df-debug"
66
+ ]
67
+ ]
68
+ },
69
+ {
70
+ "id": "htu21df-debug",
71
+ "type": "debug",
72
+ "z": "htu21df-tab",
73
+ "name": "Reading",
74
+ "active": true,
75
+ "tosidebar": true,
76
+ "console": false,
77
+ "tostatus": false,
78
+ "complete": "payload",
79
+ "targetType": "msg",
80
+ "statusVal": "",
81
+ "statusType": "auto",
82
+ "x": 800,
83
+ "y": 160,
84
+ "wires": []
85
+ }
86
+ ]
@@ -0,0 +1,85 @@
1
+ [
2
+ {
3
+ "id": "sht31-tab",
4
+ "type": "tab",
5
+ "label": "SHT31 humidity logger",
6
+ "disabled": false,
7
+ "info": "Reads temperature and relative humidity from an SHT31 every 2 s and formats them. Demonstrates the single-shot measurement with CRC checking."
8
+ },
9
+ {
10
+ "id": "sht31-inject",
11
+ "type": "inject",
12
+ "z": "sht31-tab",
13
+ "name": "2 s timer",
14
+ "props": [
15
+ {
16
+ "p": "payload"
17
+ }
18
+ ],
19
+ "repeat": "2",
20
+ "crontab": "",
21
+ "once": false,
22
+ "onceDelay": 0.1,
23
+ "topic": "",
24
+ "payloadType": "date",
25
+ "x": 160,
26
+ "y": 160,
27
+ "wires": [
28
+ [
29
+ "sht31-node"
30
+ ]
31
+ ]
32
+ },
33
+ {
34
+ "id": "sht31-node",
35
+ "type": "periph-sht31",
36
+ "z": "sht31-tab",
37
+ "name": "SHT31",
38
+ "bus": "1",
39
+ "address": "0x44",
40
+ "repeatability": "high",
41
+ "x": 380,
42
+ "y": 160,
43
+ "wires": [
44
+ [
45
+ "sht31-format"
46
+ ]
47
+ ]
48
+ },
49
+ {
50
+ "id": "sht31-format",
51
+ "type": "function",
52
+ "z": "sht31-tab",
53
+ "name": "Format",
54
+ "func": "msg.payload = msg.payload.temperature.toFixed(2) + ' °C, ' + msg.payload.humidity.toFixed(1) + ' %RH';\\nreturn msg;",
55
+ "outputs": 1,
56
+ "noerr": 0,
57
+ "initialize": "",
58
+ "finalize": "",
59
+ "libs": [],
60
+ "x": 600,
61
+ "y": 160,
62
+ "wires": [
63
+ [
64
+ "sht31-debug"
65
+ ]
66
+ ]
67
+ },
68
+ {
69
+ "id": "sht31-debug",
70
+ "type": "debug",
71
+ "z": "sht31-tab",
72
+ "name": "Reading",
73
+ "active": true,
74
+ "tosidebar": true,
75
+ "console": false,
76
+ "tostatus": false,
77
+ "complete": "payload",
78
+ "targetType": "msg",
79
+ "statusVal": "",
80
+ "statusType": "auto",
81
+ "x": 800,
82
+ "y": 160,
83
+ "wires": []
84
+ }
85
+ ]
@@ -0,0 +1,86 @@
1
+ [
2
+ {
3
+ "id": "si7021-tab",
4
+ "type": "tab",
5
+ "label": "Si7021 humidity logger",
6
+ "disabled": false,
7
+ "info": "Reads relative humidity and temperature from an Si7021 every 2 s and formats them. Demonstrates the no-hold-master RH measurement with CRC checking and the temperature of the same conversion."
8
+ },
9
+ {
10
+ "id": "si7021-inject",
11
+ "type": "inject",
12
+ "z": "si7021-tab",
13
+ "name": "2 s timer",
14
+ "props": [
15
+ {
16
+ "p": "payload"
17
+ }
18
+ ],
19
+ "repeat": "2",
20
+ "crontab": "",
21
+ "once": false,
22
+ "onceDelay": 0.1,
23
+ "topic": "",
24
+ "payloadType": "date",
25
+ "x": 160,
26
+ "y": 160,
27
+ "wires": [
28
+ [
29
+ "si7021-node"
30
+ ]
31
+ ]
32
+ },
33
+ {
34
+ "id": "si7021-node",
35
+ "type": "periph-si7021",
36
+ "z": "si7021-tab",
37
+ "name": "Si7021",
38
+ "bus": "1",
39
+ "address": "0x40",
40
+ "x": 380,
41
+ "y": 160,
42
+ "wires": [
43
+ [
44
+ "si7021-format"
45
+ ]
46
+ ],
47
+ "resolution": "12/14",
48
+ "heater": false
49
+ },
50
+ {
51
+ "id": "si7021-format",
52
+ "type": "function",
53
+ "z": "si7021-tab",
54
+ "name": "Format",
55
+ "func": "msg.payload = msg.payload.temperature_c.toFixed(2) + ' °C, ' + msg.payload.humidity_pct.toFixed(1) + ' %RH';\nreturn msg;",
56
+ "outputs": 1,
57
+ "noerr": 0,
58
+ "initialize": "",
59
+ "finalize": "",
60
+ "libs": [],
61
+ "x": 600,
62
+ "y": 160,
63
+ "wires": [
64
+ [
65
+ "si7021-debug"
66
+ ]
67
+ ]
68
+ },
69
+ {
70
+ "id": "si7021-debug",
71
+ "type": "debug",
72
+ "z": "si7021-tab",
73
+ "name": "Reading",
74
+ "active": true,
75
+ "tosidebar": true,
76
+ "console": false,
77
+ "tostatus": false,
78
+ "complete": "payload",
79
+ "targetType": "msg",
80
+ "statusVal": "",
81
+ "statusType": "auto",
82
+ "x": 800,
83
+ "y": 160,
84
+ "wires": []
85
+ }
86
+ ]
@@ -0,0 +1,67 @@
1
+ <script type="text/javascript">
2
+ RED.nodes.registerType('periph-htu21df', {
3
+ category: 'Peripheral',
4
+ color: '#C084FC',
5
+ defaults: {
6
+ name: { value: '' },
7
+ bus: { value: '1', required: true, validate: RED.validators.number() },
8
+ address: { value: '0x40' },
9
+ resolution: { value: '12/14' },
10
+ heater: { value: false }
11
+ },
12
+ inputs: 1,
13
+ outputs: 1,
14
+ icon: 'bridge.svg',
15
+ label: function() {
16
+ return this.name || ('HTU21D-F @ ' + this.address + ' (bus ' + this.bus + ')');
17
+ }
18
+ });
19
+ </script>
20
+
21
+ <script type="text/html" data-template-name="periph-htu21df">
22
+ <div class="form-row">
23
+ <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
24
+ <input type="text" id="node-input-name" placeholder="HTU21D-F">
25
+ </div>
26
+ <div class="form-row">
27
+ <label for="node-input-bus"><i class="fa fa-microchip"></i> I²C bus</label>
28
+ <input type="number" id="node-input-bus" min="0" style="width:80px"> &nbsp;(Linux /dev/i2c-N)
29
+ </div>
30
+ <div class="form-row">
31
+ <label for="node-input-address"><i class="fa fa-microchip"></i> I²C address</label>
32
+ <input type="text" id="node-input-address" style="width:80px" placeholder="0x40"> &nbsp;(fixed, 0x40)
33
+ </div>
34
+ <div class="form-row">
35
+ <label for="node-input-resolution"><i class="fa fa-cog"></i> Resolution</label>
36
+ <select id="node-input-resolution" style="width:200px">
37
+ <option value="12/14" selected>RH 12 bit / T 14 bit</option>
38
+ <option value="10/13">RH 10 bit / T 13 bit</option>
39
+ <option value="11/11">RH 11 bit / T 11 bit</option>
40
+ <option value="8/12">RH 8 bit / T 12 bit</option>
41
+ </select>
42
+ </div>
43
+ <div class="form-row">
44
+ <label for="node-input-heater"><i class="fa fa-fire"></i> Heater</label>
45
+ <input type="checkbox" id="node-input-heater" style="width:auto"> &nbsp;on-chip heater (about 5.5 mW)
46
+ </div>
47
+ </script>
48
+
49
+ <script type="text/html" data-help-name="periph-htu21df">
50
+ <p>Reads temperature and relative humidity from a Measurement Specialties HTU21D-F over I²C (fixed address 0x40)
51
+ with one temperature and one humidity measurement per message. The CRC of both results is verified.</p>
52
+ <h3>Inputs</h3>
53
+ <dl class="message-properties">
54
+ <dt>payload <span class="property-type">any</span></dt>
55
+ <dd>Any incoming message triggers one measurement.</dd>
56
+ </dl>
57
+ <h3>Outputs</h3>
58
+ <dl class="message-properties">
59
+ <dt>payload.temperature_c <span class="property-type">number</span></dt>
60
+ <dd>Temperature in °C.</dd>
61
+ <dt>payload.humidity_pct <span class="property-type">number</span></dt>
62
+ <dd>Relative humidity in %RH (not clamped, -6 to 118).</dd>
63
+ </dl>
64
+ <h3>Configuration</h3>
65
+ <p>I²C bus number, I²C address (0x40), measurement resolution (RH / temperature bits) and the on-chip heater.
66
+ With the heater on, readings drift upwards; use it only to drive off condensation.</p>
67
+ </script>
@@ -0,0 +1,52 @@
1
+ 'use strict';
2
+
3
+ module.exports = function(RED) {
4
+ const { I2CConnection } = require('periph/src/connection/i2c');
5
+ const { HTU21DFFull } = require('periph/src/chips/humidity/htu21df');
6
+
7
+ const RESOLUTIONS = { '12/14': 0, '8/12': 1, '10/13': 2, '11/11': 3 };
8
+
9
+ function HTU21DFNode(config) {
10
+ RED.nodes.createNode(this, config);
11
+ const node = this;
12
+ try {
13
+ const address = parseInt(config.address, 16) || 0x40;
14
+ const connection = new I2CConnection(parseInt(config.bus), address);
15
+ node.connection = connection;
16
+ node.driver = new HTU21DFFull(connection);
17
+ node.ready = (async () => {
18
+ await node.driver.init();
19
+ const res = RESOLUTIONS[config.resolution];
20
+ await node.driver.setResolution(res === undefined ? 0 : res);
21
+ await node.driver.setHeater(config.heater === true || config.heater === 'true');
22
+ })();
23
+ node.ready.catch((e) => {
24
+ node.error('HTU21D-F init failed: ' + e.message);
25
+ });
26
+ } catch (e) {
27
+ node.error('HTU21D-F init failed: ' + e.message);
28
+ }
29
+
30
+ node.on('input', async function(msg, send, done) {
31
+ if (!node.driver) {
32
+ node.error('HTU21D-F not initialised', msg);
33
+ done();
34
+ return;
35
+ }
36
+ try {
37
+ await node.ready;
38
+ const [temperature_c, humidity_pct] = await node.driver.read();
39
+ msg.payload = { temperature_c, humidity_pct };
40
+ send(msg);
41
+ done();
42
+ } catch (e) {
43
+ done(e);
44
+ }
45
+ });
46
+
47
+ node.on('close', function() {
48
+ if (node.connection) node.connection.close();
49
+ });
50
+ }
51
+ RED.nodes.registerType('periph-htu21df', HTU21DFNode);
52
+ };
@@ -0,0 +1,64 @@
1
+ <script type="text/javascript">
2
+ RED.nodes.registerType('periph-sht31', {
3
+ category: 'Peripheral',
4
+ color: '#C084FC',
5
+ defaults: {
6
+ name: { value: '' },
7
+ bus: { value: '1', required: true, validate: RED.validators.number() },
8
+ address: { value: '0x44' },
9
+ repeatability: { value: 'high' }
10
+ },
11
+ inputs: 1,
12
+ outputs: 1,
13
+ icon: 'bridge.svg',
14
+ label: function() {
15
+ return this.name || ('SHT31 @ ' + this.address + ' (bus ' + this.bus + ')');
16
+ }
17
+ });
18
+ </script>
19
+
20
+ <script type="text/html" data-template-name="periph-sht31">
21
+ <div class="form-row">
22
+ <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
23
+ <input type="text" id="node-input-name" placeholder="SHT31">
24
+ </div>
25
+ <div class="form-row">
26
+ <label for="node-input-bus"><i class="fa fa-microchip"></i> I²C bus</label>
27
+ <input type="number" id="node-input-bus" min="0" style="width:80px"> &nbsp;(Linux /dev/i2c-N)
28
+ </div>
29
+ <div class="form-row">
30
+ <label for="node-input-address"><i class="fa fa-microchip"></i> I²C address</label>
31
+ <select id="node-input-address" style="width:160px">
32
+ <option value="0x44" selected>0x44 (ADDR = low)</option>
33
+ <option value="0x45">0x45 (ADDR = high)</option>
34
+ </select>
35
+ </div>
36
+ <div class="form-row">
37
+ <label for="node-input-repeatability"><i class="fa fa-cog"></i> Repeatability</label>
38
+ <select id="node-input-repeatability" style="width:160px">
39
+ <option value="high" selected>High (15 ms)</option>
40
+ <option value="medium">Medium (6 ms)</option>
41
+ <option value="low">Low (4 ms)</option>
42
+ </select>
43
+ </div>
44
+ </script>
45
+
46
+ <script type="text/html" data-help-name="periph-sht31">
47
+ <p>Reads temperature and relative humidity from a Sensirion SHT31 over I²C (0x44 with ADDR low, 0x45 with
48
+ ADDR high) with one single-shot measurement per message. Both CRC bytes are verified.</p>
49
+ <h3>Inputs</h3>
50
+ <dl class="message-properties">
51
+ <dt>payload <span class="property-type">any</span></dt>
52
+ <dd>Any incoming message triggers one measurement.</dd>
53
+ </dl>
54
+ <h3>Outputs</h3>
55
+ <dl class="message-properties">
56
+ <dt>payload.temperature <span class="property-type">number</span></dt>
57
+ <dd>Temperature in °C.</dd>
58
+ <dt>payload.humidity <span class="property-type">number</span></dt>
59
+ <dd>Relative humidity in %RH.</dd>
60
+ </dl>
61
+ <h3>Configuration</h3>
62
+ <p>I²C bus number, I²C address and the single-shot repeatability (high / medium / low; measurement time
63
+ 15 / 6 / 4 ms).</p>
64
+ </script>
@@ -0,0 +1,48 @@
1
+ 'use strict';
2
+
3
+ module.exports = function(RED) {
4
+ const { I2CConnection } = require('periph/src/connection/i2c');
5
+ const { SHT31Full } = require('periph/src/chips/humidity/sht31');
6
+
7
+ function SHT31Node(config) {
8
+ RED.nodes.createNode(this, config);
9
+ const node = this;
10
+ try {
11
+ const address = parseInt(config.address, 16) || 0x44;
12
+ const connection = new I2CConnection(parseInt(config.bus), address);
13
+ node.connection = connection;
14
+ node.driver = new SHT31Full(connection);
15
+ node.ready = (async () => {
16
+ await node.driver.init();
17
+ node.driver.setRepeatability(['low', 'medium', 'high'].includes(config.repeatability) ? config.repeatability : 'high');
18
+ })();
19
+ node.ready.catch((e) => {
20
+ node.error('SHT31 init failed: ' + e.message);
21
+ });
22
+ } catch (e) {
23
+ node.error('SHT31 init failed: ' + e.message);
24
+ }
25
+
26
+ node.on('input', async function(msg, send, done) {
27
+ if (!node.driver) {
28
+ node.error('SHT31 not initialised', msg);
29
+ done();
30
+ return;
31
+ }
32
+ try {
33
+ await node.ready;
34
+ const [temperature, humidity] = await node.driver.read();
35
+ msg.payload = { temperature, humidity };
36
+ send(msg);
37
+ done();
38
+ } catch (e) {
39
+ done(e);
40
+ }
41
+ });
42
+
43
+ node.on('close', function() {
44
+ if (node.connection) node.connection.close();
45
+ });
46
+ }
47
+ RED.nodes.registerType('periph-sht31', SHT31Node);
48
+ };
@@ -0,0 +1,68 @@
1
+ <script type="text/javascript">
2
+ RED.nodes.registerType('periph-si7021', {
3
+ category: 'Peripheral',
4
+ color: '#C084FC',
5
+ defaults: {
6
+ name: { value: '' },
7
+ bus: { value: '1', required: true, validate: RED.validators.number() },
8
+ address: { value: '0x40' },
9
+ resolution: { value: '12/14' },
10
+ heater: { value: false }
11
+ },
12
+ inputs: 1,
13
+ outputs: 1,
14
+ icon: 'bridge.svg',
15
+ label: function() {
16
+ return this.name || ('Si7021 @ ' + this.address + ' (bus ' + this.bus + ')');
17
+ }
18
+ });
19
+ </script>
20
+
21
+ <script type="text/html" data-template-name="periph-si7021">
22
+ <div class="form-row">
23
+ <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
24
+ <input type="text" id="node-input-name" placeholder="Si7021">
25
+ </div>
26
+ <div class="form-row">
27
+ <label for="node-input-bus"><i class="fa fa-microchip"></i> I²C bus</label>
28
+ <input type="number" id="node-input-bus" min="0" style="width:80px"> &nbsp;(Linux /dev/i2c-N)
29
+ </div>
30
+ <div class="form-row">
31
+ <label for="node-input-address"><i class="fa fa-microchip"></i> I²C address</label>
32
+ <input type="text" id="node-input-address" style="width:80px" placeholder="0x40"> &nbsp;(fixed, 0x40)
33
+ </div>
34
+ <div class="form-row">
35
+ <label for="node-input-resolution"><i class="fa fa-cog"></i> Resolution</label>
36
+ <select id="node-input-resolution" style="width:200px">
37
+ <option value="12/14" selected>RH 12 bit / T 14 bit</option>
38
+ <option value="10/13">RH 10 bit / T 13 bit</option>
39
+ <option value="11/11">RH 11 bit / T 11 bit</option>
40
+ <option value="8/12">RH 8 bit / T 12 bit</option>
41
+ </select>
42
+ </div>
43
+ <div class="form-row">
44
+ <label for="node-input-heater"><i class="fa fa-fire"></i> Heater</label>
45
+ <input type="checkbox" id="node-input-heater" style="width:auto"> &nbsp;on-chip heater (3.1 mA)
46
+ </div>
47
+ </script>
48
+
49
+ <script type="text/html" data-help-name="periph-si7021">
50
+ <p>Reads relative humidity and temperature from a Silicon Labs Si7021 over I²C (fixed address 0x40) with one
51
+ relative-humidity measurement per message; the temperature comes from the same conversion. The CRC of the
52
+ humidity result is verified.</p>
53
+ <h3>Inputs</h3>
54
+ <dl class="message-properties">
55
+ <dt>payload <span class="property-type">any</span></dt>
56
+ <dd>Any incoming message triggers one measurement.</dd>
57
+ </dl>
58
+ <h3>Outputs</h3>
59
+ <dl class="message-properties">
60
+ <dt>payload.temperature_c <span class="property-type">number</span></dt>
61
+ <dd>Temperature in °C.</dd>
62
+ <dt>payload.humidity_pct <span class="property-type">number</span></dt>
63
+ <dd>Relative humidity in %RH (0–100).</dd>
64
+ </dl>
65
+ <h3>Configuration</h3>
66
+ <p>I²C bus number, I²C address (0x40), measurement resolution (RH / temperature bits) and the on-chip heater.
67
+ With the heater on, readings drift upwards; use it only to drive off condensation.</p>
68
+ </script>
@@ -0,0 +1,51 @@
1
+ 'use strict';
2
+
3
+ module.exports = function(RED) {
4
+ const { I2CConnection } = require('periph/src/connection/i2c');
5
+ const { Si7021Full } = require('periph/src/chips/humidity/si7021');
6
+
7
+ const RESOLUTIONS = { '12/14': [12, 14], '8/12': [8, 12], '10/13': [10, 13], '11/11': [11, 11] };
8
+
9
+ function Si7021Node(config) {
10
+ RED.nodes.createNode(this, config);
11
+ const node = this;
12
+ try {
13
+ const address = parseInt(config.address, 16) || 0x40;
14
+ const connection = new I2CConnection(parseInt(config.bus), address);
15
+ node.connection = connection;
16
+ node.driver = new Si7021Full(connection);
17
+ node.ready = (async () => {
18
+ const res = RESOLUTIONS[config.resolution] || RESOLUTIONS['12/14'];
19
+ await node.driver.setResolution(res[0], res[1]);
20
+ await node.driver.setHeater(config.heater === true || config.heater === 'true');
21
+ })();
22
+ node.ready.catch((e) => {
23
+ node.error('Si7021 init failed: ' + e.message);
24
+ });
25
+ } catch (e) {
26
+ node.error('Si7021 init failed: ' + e.message);
27
+ }
28
+
29
+ node.on('input', async function(msg, send, done) {
30
+ if (!node.driver) {
31
+ node.error('Si7021 not initialised', msg);
32
+ done();
33
+ return;
34
+ }
35
+ try {
36
+ await node.ready;
37
+ const [temperature_c, humidity_pct] = await node.driver.read();
38
+ msg.payload = { temperature_c, humidity_pct };
39
+ send(msg);
40
+ done();
41
+ } catch (e) {
42
+ done(e);
43
+ }
44
+ });
45
+
46
+ node.on('close', function() {
47
+ if (node.connection) node.connection.close();
48
+ });
49
+ }
50
+ RED.nodes.registerType('periph-si7021', Si7021Node);
51
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-periph-humidity",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Node-RED nodes for humidity sensor chips",
5
5
  "keywords": [
6
6
  "node-red",
@@ -12,7 +12,10 @@
12
12
  ],
13
13
  "node-red": {
14
14
  "nodes": {
15
- "dht11": "nodes/dht11/dht11.js"
15
+ "dht11": "nodes/dht11/dht11.js",
16
+ "htu21df": "nodes/htu21df/htu21df.js",
17
+ "sht31": "nodes/sht31/sht31.js",
18
+ "si7021": "nodes/si7021/si7021.js"
16
19
  }
17
20
  },
18
21
  "dependencies": {