@halsystems/red-bacnet 1.3.0 → 1.4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.4.0]
4
+ ### Changed
5
+ - `read_point` readMethod removed `Read Multiple Fallback Single` option
6
+
7
+ ### Fixed
8
+ - Fixed dummy event emitter not catching output and error
9
+ - Fixed read point event emitter not catching error
10
+
3
11
  ## [1.3.0]
4
12
  ### Added
5
13
  - WritePoint added concurrentTaskDelay config to control delay between concurrent tasks
package/common/bacnet.js CHANGED
@@ -6,7 +6,7 @@ const EventEmitter = require('events');
6
6
  const bacnet = require('@root/ext/node-bacstack/dist/index.js')
7
7
  const baEnum = bacnet.enum;
8
8
 
9
- const { EVENT_ERROR } = require('@root/common/core/constant.js')
9
+ const { EVENT_ERROR, EVENT_OUTPUT } = require('@root/common/core/constant.js')
10
10
  const { concurrentTasks } = require('@root/common/core/concurrent.js')
11
11
  const { getErrMsg } = require('@root/common/func.js')
12
12
 
@@ -266,6 +266,9 @@ module.exports = {
266
266
  let failedCount = 0
267
267
  let result_single = []
268
268
  const dummyEventEmitter = new EventEmitter();
269
+ dummyEventEmitter.on(EVENT_OUTPUT, () => { });
270
+ dummyEventEmitter.on(EVENT_ERROR, () => { });
271
+
269
272
  const tasks = reqArr.slice(reqArrIndexNext).flatMap((req, x) =>
270
273
  req.properties.map((prop, y) => ({
271
274
  id: `${x}-${y}`,
@@ -223,6 +223,10 @@ module.exports = {
223
223
  count++;
224
224
  });
225
225
 
226
+ smartReadEvent.on(EVENT_ERROR, (data) => {
227
+ this.eventEmitter.emit(EVENT_ERROR, data)
228
+ });
229
+
226
230
  const tasks = entries
227
231
  .filter(([_, v]) => Array.isArray(v.points) && v.points.length > 0) // eslint-disable-line
228
232
  .map(([k, v]) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@halsystems/red-bacnet",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "NodeRED BACnet IP client",
5
5
  "email": "open_source@halsystems.com.au",
6
6
  "repository": {
@@ -33,8 +33,7 @@
33
33
  <label for="node-input-readMethod"><i class="fa fa-list"></i> Read Method</label>
34
34
  <select id="node-input-readMethod">
35
35
  <option value="0">Read Single Only</option>
36
- <option value="1">Read Multiple Fallback Single</option>
37
- <option value="2">Comprehensive Read</option>
36
+ <option value="1">Comprehensive Read</option>
38
37
  </select>
39
38
  </div>
40
39
  <div class="form-row">
@@ -62,8 +61,7 @@
62
61
 
63
62
  <dt>readMethod<span class="property-type">number</span></dt>
64
63
  <dd> <b>Read Single Only</b>: use <code>readProperty</code></dd>
65
- <dd> <b>Read Multiple Fallback Single</b>: try <code>readPropertyMultiple</code> with consevative query size, fallback to <code>readProperty</code> if failed</dd>
66
- <dd> <b>Comprehensive Read</b>: try <code>readPropertyMultiple</code> twice with high and conservative query size,fallback to <code>readProperty</code> if failed</dd>
64
+ <dd> <b>Comprehensive Read</b>: try <code>readPropertyMultiple</code>, reduce query size if failed, and fallback to <code>readProperty</code> if query size reduced to 1</dd>
67
65
 
68
66
  <dt>maxConcurrentDeviceRead<span class="property-type">number</span></dt>
69
67
  <dd> Devices count to discover simultaneously.</dd>