@ncd-io/node-red-enterprise-sensors 0.1.1 → 0.1.2

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.
@@ -741,6 +741,14 @@ module.exports = class WirelessSensor{
741
741
  var packet = [244, 4, 0, 0, 0, reading_type];
742
742
  return this.config_send(sensor_mac, packet);
743
743
  }
744
+ config_set_motion_threshold_46(sensor_mac, value){
745
+ console.log('config_set_motion_threshold_46');
746
+ let packet = [244, 1, 0, 0, 0];
747
+ let threshold = int2Bytes((value), 4);
748
+ packet.push(...threshold);
749
+ console.log(packet);
750
+ return this.config_send(sensor_mac, packet);
751
+ }
744
752
 
745
753
  config_set_sensor_forced_calibration(sensor_mac, value){
746
754
  var packet = [244, 31, 0, 0, 0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ncd-io/node-red-enterprise-sensors",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wireless.html CHANGED
@@ -320,6 +320,9 @@
320
320
 
321
321
  payload_length_80_active:{value:""},
322
322
  payload_length_80:{value:3, validate: NCD_validators.number_range(0, 3)},
323
+
324
+ motion_threshold_46_active:{value:""},
325
+ motion_threshold_46:{value: 100, validate: NCD_validators.number_range(0, 4294967295)},
323
326
  },
324
327
  inputs: 0,
325
328
  outputs: 1,
@@ -1574,6 +1577,20 @@
1574
1577
  </div>
1575
1578
  </div>
1576
1579
  </div>
1580
+ <div class="ncd-dependent" data-sensor-46>
1581
+ <hr>
1582
+ <div class="form-row ncd-active-check">
1583
+ <strong>Motion Threshold</strong>
1584
+ <div>
1585
+ <label for="node-input-motion_threshold_46_active">Active:</label>
1586
+ <input type="checkbox" id="node-input-motion_threshold_46_active" class="ncd-config-toggle" data-target-id="node-input-motion_threshold_46" value="1">
1587
+ </div>
1588
+ <div>
1589
+ <label for="node-input-motion_threshold_46"><i class="icon-tag"></i>Value:</label>
1590
+ <input type="text" id="node-input-motion_threshold_46" placeholder="0-4294967295" value="100">
1591
+ </div>
1592
+ </div>
1593
+ </div>
1577
1594
  <div class="ncd-dependent" data-sensor-10000 data-sensor-10012>
1578
1595
  <div class="form-row">
1579
1596
  <button id="config_sensor">Configure Now</button>
package/wireless.js CHANGED
@@ -430,6 +430,11 @@ module.exports = function(RED) {
430
430
  promises.sensor_boot_time_420ma = node.config_gateway.config_set_sensor_boot_time_420ma(mac, parseInt(config.sensor_boot_time_420ma));
431
431
  }
432
432
  break;
433
+ case 46:
434
+ if(config.motion_threshold_46_active){
435
+ promises.motion_threshold_46 = node.config_gateway.config_set_motion_threshold_46(mac, parseInt(config.motion_threshold_46));
436
+ }
437
+ break;
433
438
  case 47:
434
439
  if(config.roll_angle_threshold_47_active){
435
440
  promises.roll_angle_threshold_47 = node.config_gateway.config_set_roll_threshold_47(mac, parseInt(config.roll_angle_threshold_47));