node-red-contrib-periph-environmental 1.5.1 → 1.5.3

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
@@ -1,6 +1,10 @@
1
1
  # node-red-contrib-periph-environmental
2
2
 
3
- Node-RED nodes for environmental sensor chips — part of the [Periph](https://github.com/tuhde/Periph) library.
3
+ Node-RED nodes for environmental sensor chips: AHT10, AHT20, AHT21, AM2315, AM2320, BME280, BME680 — part of the [Periph](https://github.com/tuhde/Periph) library.
4
+
5
+ **Supported chips (7):** AHT10, AHT20, AHT21, AM2315, AM2320, BME280, BME680.
6
+
7
+ Each chip has a sensor/actuator node plus a shared `-device` config node that holds the bus settings. Importable example flows are in [`examples/`](https://github.com/tuhde/Periph/tree/main/nodejs/packages/node-red-contrib-periph-environmental/examples).
4
8
 
5
9
  ## Install
6
10
 
@@ -22,12 +26,14 @@ npm install node-red-contrib-periph-environmental
22
26
  | `aht20` | input | Reads temperature and humidity from an AHT20 environmental sensor over I²C. |
23
27
  | `aht21-device` | config | I²C bus and address for an AHT21 |
24
28
  | `aht21` | input | Reads temperature and humidity from an AHT21 environmental sensor over I²C. |
25
- | `periph-am2315` | input | Reads temperature and relative humidity from an Aosong AM2315 over I²C (fixed address 0x5C). The sensor sleeps between transactions and returns the result of the previous measurement; the node keeps transactions at least 2 s apart, so a message arriving earlier is answered after the remaining delay. Every response is CRC-16 checked. |
26
- | `periph-am2320` | input | Reads temperature and relative humidity from an Aosong AM2320 over I²C (fixed address 0x5C). The sensor sleeps between transactions and returns the result of the previous measurement; the node keeps transactions at least 2 s apart, so a message arriving earlier is answered after the remaining delay. Every response is CRC-16 checked. |
29
+ | `am2315-device` | config | I²C bus and address for an AM2315 |
30
+ | `am2315` | input | Reads temperature and relative humidity from an Aosong AM2315 over I²C (fixed address 0x5C). The sensor sleeps between transactions and returns the result of the previous measurement; the node keeps transactions at least 2 s apart, so a message arriving earlier is answered after the remaining delay. Every response is CRC-16 checked. |
31
+ | `am2320-device` | config | I²C bus and address for an AM2320 |
32
+ | `am2320` | input | Reads temperature and relative humidity from an Aosong AM2320 over I²C (fixed address 0x5C). The sensor sleeps between transactions and returns the result of the previous measurement; the node keeps transactions at least 2 s apart, so a message arriving earlier is answered after the remaining delay. Every response is CRC-16 checked. |
27
33
  | `bme280-device` | config | Bus configuration for a BME280 |
28
- | `periph-bme280` | input | Reads temperature, pressure, humidity, altitude, and dew point from a BME280 combined humidity + pressure + temperature sensor. |
34
+ | `bme280` | input | Reads temperature, pressure, humidity, altitude, and dew point from a BME280 combined humidity + pressure + temperature sensor. |
29
35
  | `bme680-device` | config | Bus configuration for a BME680 |
30
- | `periph-bme680` | input | Reads temperature, pressure, humidity, gas resistance, altitude, and dew point from a BME680 4-in-1 environmental sensor. |
36
+ | `bme680` | input | Reads temperature, pressure, humidity, gas resistance, altitude, and dew point from a BME680 4-in-1 environmental sensor. |
31
37
 
32
38
  ## Links
33
39
 
@@ -30,20 +30,26 @@
30
30
  ]
31
31
  ]
32
32
  },
33
+ {
34
+ "id": "am2315-device-1",
35
+ "type": "am2315-device",
36
+ "name": "AM2315",
37
+ "address": "0x5C",
38
+ "bus": "1"
39
+ },
33
40
  {
34
41
  "id": "am2315-node",
35
- "type": "periph-am2315",
42
+ "type": "am2315",
36
43
  "z": "am2315-tab",
37
44
  "name": "AM2315",
38
- "bus": "1",
39
- "address": "0x5C",
40
45
  "x": 380,
41
46
  "y": 160,
42
47
  "wires": [
43
48
  [
44
49
  "am2315-format"
45
50
  ]
46
- ]
51
+ ],
52
+ "device": "am2315-device-1"
47
53
  },
48
54
  {
49
55
  "id": "am2315-format",
@@ -30,20 +30,26 @@
30
30
  ]
31
31
  ]
32
32
  },
33
+ {
34
+ "id": "am2320-device-1",
35
+ "type": "am2320-device",
36
+ "name": "AM2320",
37
+ "address": "0x5C",
38
+ "bus": "1"
39
+ },
33
40
  {
34
41
  "id": "am2320-node",
35
- "type": "periph-am2320",
42
+ "type": "am2320",
36
43
  "z": "am2320-tab",
37
44
  "name": "AM2320",
38
- "bus": "1",
39
- "address": "0x5C",
40
45
  "x": 380,
41
46
  "y": 160,
42
47
  "wires": [
43
48
  [
44
49
  "am2320-format"
45
50
  ]
46
- ]
51
+ ],
52
+ "device": "am2320-device-1"
47
53
  },
48
54
  {
49
55
  "id": "am2320-format",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  {
16
16
  "id": "bme280-read-1",
17
- "type": "periph-bme280",
17
+ "type": "bme280",
18
18
  "name": "BME280 Indoor",
19
19
  "device": "bme280-device-1",
20
20
  "seaLevelHpa": "1013.25",
@@ -156,6 +156,6 @@
156
156
  "name": "BME280 Demo",
157
157
  "icon": "dashboard",
158
158
  "order": 1,
159
- "info": "This flow demonstrates the BME280 combined humidity + pressure + temperature sensor.\n\nAn inject node fires every 10 seconds into the periph-bme280 node. The output goes to a debug node and five ui_chart nodes showing temperature, pressure, humidity, altitude, and dew point over time.\n\nA condensation-alert function node watches the dew-point trace and emits a 'Condensation likely' alert when temperature minus dew point falls below 2 °C — useful for HVAC, greenhouse, and crawl-space monitoring where surface condensation can damage equipment or promote mould.\n\nThe BME280 combines three sensors (BMP280 pressure/temperature plus a humidity front-end) in one package, making it ideal for indoor air quality, weather stations, and HVAC applications where a separate humidity sensor would otherwise be needed."
159
+ "info": "This flow demonstrates the BME280 combined humidity + pressure + temperature sensor.\n\nAn inject node fires every 10 seconds into the bme280 node. The output goes to a debug node and five ui_chart nodes showing temperature, pressure, humidity, altitude, and dew point over time.\n\nA condensation-alert function node watches the dew-point trace and emits a 'Condensation likely' alert when temperature minus dew point falls below 2 °C — useful for HVAC, greenhouse, and crawl-space monitoring where surface condensation can damage equipment or promote mould.\n\nThe BME280 combines three sensors (BMP280 pressure/temperature plus a humidity front-end) in one package, making it ideal for indoor air quality, weather stations, and HVAC applications where a separate humidity sensor would otherwise be needed."
160
160
  }
161
161
  ]
@@ -14,7 +14,7 @@
14
14
  },
15
15
  {
16
16
  "id": "bme680-read-1",
17
- "type": "periph-bme680",
17
+ "type": "bme680",
18
18
  "name": "BME680 Air Quality",
19
19
  "device": "bme680-device-1",
20
20
  "seaLevelHpa": "1013.25",
@@ -170,6 +170,6 @@
170
170
  "name": "BME680 Demo",
171
171
  "icon": "dashboard",
172
172
  "order": 1,
173
- "info": "This flow demonstrates the BME680 4-in-1 environmental sensor (temperature, pressure, humidity, gas resistance).\n\nAn inject node fires every 10 seconds into the periph-bme680 node. The output goes to a debug node and six ui_chart nodes showing temperature, pressure, humidity, gas resistance, altitude, and dew point.\n\nA VOC alert function node watches the gas-resistance trace — a sustained drop below 80% of the running 24-hour median triggers a \"VOC concentration rising\" alert. This demonstrates that even the raw uncalibrated gas reading is useful as a relative VOC indicator without the closed-source BSEC library.\n\nGas resistance drops when VOCs (isopropyl alcohol, marker pen fumes, cooking) are present near the sensor and recovers as the air clears."
173
+ "info": "This flow demonstrates the BME680 4-in-1 environmental sensor (temperature, pressure, humidity, gas resistance).\n\nAn inject node fires every 10 seconds into the bme680 node. The output goes to a debug node and six ui_chart nodes showing temperature, pressure, humidity, gas resistance, altitude, and dew point.\n\nA VOC alert function node watches the gas-resistance trace — a sustained drop below 80% of the running 24-hour median triggers a \"VOC concentration rising\" alert. This demonstrates that even the raw uncalibrated gas reading is useful as a relative VOC indicator without the closed-source BSEC library.\n\nGas resistance drops when VOCs (isopropyl alcohol, marker pen fumes, cooking) are present near the sensor and recovers as the air clears."
174
174
  }
175
175
  ]
@@ -1,37 +1,62 @@
1
+ <!-- Config node: one instance per physical device -->
1
2
  <script type="text/javascript">
2
- RED.nodes.registerType('periph-am2315', {
3
- category: 'Peripheral',
4
- color: '#C084FC',
3
+ RED.nodes.registerType('am2315-device', {
4
+ category: 'config',
5
5
  defaults: {
6
6
  name: { value: '' },
7
7
  bus: { value: '1', required: true, validate: RED.validators.number() },
8
8
  address: { value: '0x5C' }
9
9
  },
10
- inputs: 1,
11
- outputs: 1,
12
- icon: 'bridge.svg',
13
10
  label: function() {
14
11
  return this.name || ('AM2315 @ ' + this.address + ' (bus ' + this.bus + ')');
15
12
  }
16
13
  });
17
14
  </script>
18
15
 
19
- <script type="text/html" data-template-name="periph-am2315">
16
+ <script type="text/html" data-template-name="am2315-device">
20
17
  <div class="form-row">
21
- <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
22
- <input type="text" id="node-input-name" placeholder="AM2315">
18
+ <label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
19
+ <input type="text" id="node-config-input-name" placeholder="AM2315">
23
20
  </div>
24
21
  <div class="form-row">
25
- <label for="node-input-bus"><i class="fa fa-microchip"></i> I²C bus</label>
26
- <input type="number" id="node-input-bus" min="0" style="width:80px"> &nbsp;(Linux /dev/i2c-N, standard mode)
22
+ <label for="node-config-input-bus"><i class="fa fa-microchip"></i> I²C bus</label>
23
+ <input type="number" id="node-config-input-bus" min="0" style="width:80px"> &nbsp;(Linux /dev/i2c-N, standard mode)
24
+ </div>
25
+ <div class="form-row">
26
+ <label for="node-config-input-address"><i class="fa fa-microchip"></i> I²C address</label>
27
+ <input type="text" id="node-config-input-address" style="width:80px" placeholder="0x5C"> &nbsp;(fixed, 0x5C)
28
+ </div>
29
+ </script>
30
+
31
+ <!-- Read node -->
32
+ <script type="text/javascript">
33
+ RED.nodes.registerType('am2315', {
34
+ category: 'Peripheral',
35
+ color: '#C084FC',
36
+ defaults: {
37
+ name: { value: '' },
38
+ device: { value: '', type: 'am2315-device', required: true }
39
+ },
40
+ inputs: 1,
41
+ outputs: 1,
42
+ icon: 'bridge.svg',
43
+ label: function() { return this.name || 'AM2315'; },
44
+ paletteLabel: 'AM2315'
45
+ });
46
+ </script>
47
+
48
+ <script type="text/html" data-template-name="am2315">
49
+ <div class="form-row">
50
+ <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
51
+ <input type="text" id="node-input-name" placeholder="AM2315">
27
52
  </div>
28
53
  <div class="form-row">
29
- <label for="node-input-address"><i class="fa fa-microchip"></i> I²C address</label>
30
- <input type="text" id="node-input-address" style="width:80px" placeholder="0x5C"> &nbsp;(fixed, 0x5C)
54
+ <label for="node-input-device"><i class="fa fa-microchip"></i> Device</label>
55
+ <input type="text" id="node-input-device">
31
56
  </div>
32
57
  </script>
33
58
 
34
- <script type="text/html" data-help-name="periph-am2315">
59
+ <script type="text/html" data-help-name="am2315">
35
60
  <p>Reads temperature and relative humidity from an Aosong AM2315 over I²C (fixed address 0x5C). The sensor
36
61
  sleeps between transactions and returns the result of the <em>previous</em> measurement; the node keeps
37
62
  transactions at least 2 s apart, so a message arriving earlier is answered after the remaining delay.
@@ -4,7 +4,7 @@ module.exports = function(RED) {
4
4
  const { I2CConnection } = require('periph/src/connection/i2c');
5
5
  const { AM2315Full } = require('periph/src/chips/environmental/am2315');
6
6
 
7
- function AM2315Node(config) {
7
+ function AM2315DeviceNode(config) {
8
8
  RED.nodes.createNode(this, config);
9
9
  const node = this;
10
10
  try {
@@ -16,17 +16,28 @@ module.exports = function(RED) {
16
16
  node.error('AM2315 init failed: ' + e.message);
17
17
  }
18
18
 
19
+ node.on('close', function() {
20
+ if (node.connection) node.connection.close();
21
+ });
22
+ }
23
+ RED.nodes.registerType('am2315-device', AM2315DeviceNode);
24
+
25
+ function AM2315ReadNode(config) {
26
+ RED.nodes.createNode(this, config);
27
+ const node = this;
28
+ const deviceNode = RED.nodes.getNode(config.device) || {};
29
+
19
30
  // Messages are handled one at a time; the driver itself waits the >= 2 s between transactions.
20
31
  let queue = Promise.resolve();
21
32
  node.on('input', function(msg, send, done) {
22
- if (!node.driver) {
33
+ if (!deviceNode.driver) {
23
34
  node.error('AM2315 not initialised', msg);
24
35
  done();
25
36
  return;
26
37
  }
27
38
  queue = queue.then(async () => {
28
39
  try {
29
- msg.payload = await node.driver.read();
40
+ msg.payload = await deviceNode.driver.read();
30
41
  send(msg);
31
42
  done();
32
43
  } catch (e) {
@@ -34,10 +45,6 @@ module.exports = function(RED) {
34
45
  }
35
46
  });
36
47
  });
37
-
38
- node.on('close', function() {
39
- if (node.connection) node.connection.close();
40
- });
41
48
  }
42
- RED.nodes.registerType('periph-am2315', AM2315Node);
49
+ RED.nodes.registerType('am2315', AM2315ReadNode);
43
50
  };
@@ -1,37 +1,62 @@
1
+ <!-- Config node: one instance per physical device -->
1
2
  <script type="text/javascript">
2
- RED.nodes.registerType('periph-am2320', {
3
- category: 'Peripheral',
4
- color: '#C084FC',
3
+ RED.nodes.registerType('am2320-device', {
4
+ category: 'config',
5
5
  defaults: {
6
6
  name: { value: '' },
7
7
  bus: { value: '1', required: true, validate: RED.validators.number() },
8
8
  address: { value: '0x5C' }
9
9
  },
10
- inputs: 1,
11
- outputs: 1,
12
- icon: 'bridge.svg',
13
10
  label: function() {
14
11
  return this.name || ('AM2320 @ ' + this.address + ' (bus ' + this.bus + ')');
15
12
  }
16
13
  });
17
14
  </script>
18
15
 
19
- <script type="text/html" data-template-name="periph-am2320">
16
+ <script type="text/html" data-template-name="am2320-device">
20
17
  <div class="form-row">
21
- <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
22
- <input type="text" id="node-input-name" placeholder="AM2320">
18
+ <label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
19
+ <input type="text" id="node-config-input-name" placeholder="AM2320">
23
20
  </div>
24
21
  <div class="form-row">
25
- <label for="node-input-bus"><i class="fa fa-microchip"></i> I²C bus</label>
26
- <input type="number" id="node-input-bus" min="0" style="width:80px"> &nbsp;(Linux /dev/i2c-N, standard mode)
22
+ <label for="node-config-input-bus"><i class="fa fa-microchip"></i> I²C bus</label>
23
+ <input type="number" id="node-config-input-bus" min="0" style="width:80px"> &nbsp;(Linux /dev/i2c-N, standard mode)
24
+ </div>
25
+ <div class="form-row">
26
+ <label for="node-config-input-address"><i class="fa fa-microchip"></i> I²C address</label>
27
+ <input type="text" id="node-config-input-address" style="width:80px" placeholder="0x5C"> &nbsp;(fixed, 0x5C)
28
+ </div>
29
+ </script>
30
+
31
+ <!-- Read node -->
32
+ <script type="text/javascript">
33
+ RED.nodes.registerType('am2320', {
34
+ category: 'Peripheral',
35
+ color: '#C084FC',
36
+ defaults: {
37
+ name: { value: '' },
38
+ device: { value: '', type: 'am2320-device', required: true }
39
+ },
40
+ inputs: 1,
41
+ outputs: 1,
42
+ icon: 'bridge.svg',
43
+ label: function() { return this.name || 'AM2320'; },
44
+ paletteLabel: 'AM2320'
45
+ });
46
+ </script>
47
+
48
+ <script type="text/html" data-template-name="am2320">
49
+ <div class="form-row">
50
+ <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
51
+ <input type="text" id="node-input-name" placeholder="AM2320">
27
52
  </div>
28
53
  <div class="form-row">
29
- <label for="node-input-address"><i class="fa fa-microchip"></i> I²C address</label>
30
- <input type="text" id="node-input-address" style="width:80px" placeholder="0x5C"> &nbsp;(fixed, 0x5C)
54
+ <label for="node-input-device"><i class="fa fa-microchip"></i> Device</label>
55
+ <input type="text" id="node-input-device">
31
56
  </div>
32
57
  </script>
33
58
 
34
- <script type="text/html" data-help-name="periph-am2320">
59
+ <script type="text/html" data-help-name="am2320">
35
60
  <p>Reads temperature and relative humidity from an Aosong AM2320 over I²C (fixed address 0x5C). The sensor
36
61
  sleeps between transactions and returns the result of the <em>previous</em> measurement; the node keeps
37
62
  transactions at least 2 s apart, so a message arriving earlier is answered after the remaining delay.
@@ -4,7 +4,7 @@ module.exports = function(RED) {
4
4
  const { I2CConnection } = require('periph/src/connection/i2c');
5
5
  const { AM2320Full } = require('periph/src/chips/environmental/am2320');
6
6
 
7
- function AM2320Node(config) {
7
+ function AM2320DeviceNode(config) {
8
8
  RED.nodes.createNode(this, config);
9
9
  const node = this;
10
10
  try {
@@ -16,17 +16,28 @@ module.exports = function(RED) {
16
16
  node.error('AM2320 init failed: ' + e.message);
17
17
  }
18
18
 
19
+ node.on('close', function() {
20
+ if (node.connection) node.connection.close();
21
+ });
22
+ }
23
+ RED.nodes.registerType('am2320-device', AM2320DeviceNode);
24
+
25
+ function AM2320ReadNode(config) {
26
+ RED.nodes.createNode(this, config);
27
+ const node = this;
28
+ const deviceNode = RED.nodes.getNode(config.device) || {};
29
+
19
30
  // Messages are handled one at a time; the driver itself waits the >= 2 s between transactions.
20
31
  let queue = Promise.resolve();
21
32
  node.on('input', function(msg, send, done) {
22
- if (!node.driver) {
33
+ if (!deviceNode.driver) {
23
34
  node.error('AM2320 not initialised', msg);
24
35
  done();
25
36
  return;
26
37
  }
27
38
  queue = queue.then(async () => {
28
39
  try {
29
- msg.payload = await node.driver.read();
40
+ msg.payload = await deviceNode.driver.read();
30
41
  send(msg);
31
42
  done();
32
43
  } catch (e) {
@@ -34,10 +45,6 @@ module.exports = function(RED) {
34
45
  }
35
46
  });
36
47
  });
37
-
38
- node.on('close', function() {
39
- if (node.connection) node.connection.close();
40
- });
41
48
  }
42
- RED.nodes.registerType('periph-am2320', AM2320Node);
49
+ RED.nodes.registerType('am2320', AM2320ReadNode);
43
50
  };
@@ -103,7 +103,7 @@
103
103
 
104
104
  <!-- Read node: trigger → measurements -->
105
105
  <script type="text/javascript">
106
- RED.nodes.registerType('periph-bme280', {
106
+ RED.nodes.registerType('bme280', {
107
107
  category: 'Peripheral',
108
108
  color: '#C084FC',
109
109
  defaults: {
@@ -119,7 +119,7 @@
119
119
  });
120
120
  </script>
121
121
 
122
- <script type="text/html" data-template-name="periph-bme280">
122
+ <script type="text/html" data-template-name="bme280">
123
123
  <div class="form-row">
124
124
  <label for="node-input-device"><i class="fa fa-microchip"></i> Device</label>
125
125
  <input type="text" id="node-input-device">
@@ -134,7 +134,7 @@
134
134
  </div>
135
135
  </script>
136
136
 
137
- <script type="text/html" data-help-name="periph-bme280">
137
+ <script type="text/html" data-help-name="bme280">
138
138
  <p>Reads temperature, pressure, humidity, altitude, and dew point
139
139
  from a BME280 combined humidity + pressure + temperature sensor.</p>
140
140
  <p>Any input message triggers a measurement. The device is configured via a <b>bme280-device</b> config node.</p>
@@ -67,5 +67,5 @@ module.exports = function(RED) {
67
67
  }
68
68
  });
69
69
  }
70
- RED.nodes.registerType('periph-bme280', BME280ReadNode);
70
+ RED.nodes.registerType('bme280', BME280ReadNode);
71
71
  };
@@ -93,7 +93,7 @@
93
93
 
94
94
  <!-- Read node: trigger → measurements -->
95
95
  <script type="text/javascript">
96
- RED.nodes.registerType('periph-bme680', {
96
+ RED.nodes.registerType('bme680', {
97
97
  category: 'Peripheral',
98
98
  color: '#C084FC',
99
99
  defaults: {
@@ -109,7 +109,7 @@
109
109
  });
110
110
  </script>
111
111
 
112
- <script type="text/html" data-template-name="periph-bme680">
112
+ <script type="text/html" data-template-name="bme680">
113
113
  <div class="form-row">
114
114
  <label for="node-input-device"><i class="fa fa-microchip"></i> Device</label>
115
115
  <input type="text" id="node-input-device">
@@ -124,7 +124,7 @@
124
124
  </div>
125
125
  </script>
126
126
 
127
- <script type="text/html" data-help-name="periph-bme680">
127
+ <script type="text/html" data-help-name="bme680">
128
128
  <p>Reads temperature, pressure, humidity, gas resistance, altitude, and dew point
129
129
  from a BME680 4-in-1 environmental sensor.</p>
130
130
  <p>Any input message triggers a measurement. The device is configured via a <b>bme680-device</b> config node.</p>
@@ -66,5 +66,5 @@ module.exports = function(RED) {
66
66
  }
67
67
  });
68
68
  }
69
- RED.nodes.registerType('periph-bme680', BME680ReadNode);
69
+ RED.nodes.registerType('bme680', BME680ReadNode);
70
70
  };
package/package.json CHANGED
@@ -1,17 +1,25 @@
1
1
  {
2
2
  "name": "node-red-contrib-periph-environmental",
3
- "version": "1.5.1",
4
- "description": "Node-RED nodes for environmental sensor chips",
3
+ "version": "1.5.3",
4
+ "description": "Node-RED nodes for environmental sensor chips: AHT10, AHT20, AHT21, AM2315, AM2320, BME280, BME680",
5
5
  "keywords": [
6
6
  "node-red",
7
7
  "environmental",
8
8
  "i2c",
9
9
  "spi",
10
10
  "sensor",
11
- "peripheral"
11
+ "peripheral",
12
+ "node-red-contrib",
13
+ "aht10",
14
+ "aht20",
15
+ "aht21",
16
+ "am2315",
17
+ "am2320",
18
+ "bme280",
19
+ "bme680"
12
20
  ],
13
- "main": "index.js",
14
21
  "node-red": {
22
+ "version": ">=3.0.0",
15
23
  "nodes": {
16
24
  "aht10": "nodes/aht10/aht10.js",
17
25
  "aht20": "nodes/aht20/aht20.js",
package/index.js DELETED
@@ -1,11 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- module.exports = function(RED) {
5
- const nodesDir = path.join(__dirname, 'nodes');
6
- if (!fs.existsSync(nodesDir)) return;
7
- fs.readdirSync(nodesDir).forEach(function(chip) {
8
- const nodeFile = path.join(nodesDir, chip, chip + '.js');
9
- if (fs.existsSync(nodeFile)) require(nodeFile)(RED);
10
- });
11
- };