@ncd-io/node-red-enterprise-sensors 1.2.1 → 1.2.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.
@@ -1233,13 +1233,13 @@ module.exports = class WirelessSensor{
1233
1233
  }
1234
1234
  config_set_accelerometer_threshold_108(sensor_mac, value){
1235
1235
  console.log('config_set_accelerometer_threshold_108');
1236
- var packet = [244, 32, 0, 0, 0, 1, value];
1236
+ var packet = [244, 32, 0, 0, 0, value];
1237
1237
  console.log(packet);
1238
1238
  return this.config_send(sensor_mac, packet);
1239
1239
  }
1240
1240
  config_set_debounce_time_108(sensor_mac, value){
1241
1241
  console.log('config_set_debounce_time_108');
1242
- var packet = [244, 39, 0, 0, 0, 64, value];
1242
+ var packet = [244, 39, 0, 0, 0, value];
1243
1243
  console.log(packet);
1244
1244
  return this.config_send(sensor_mac, packet);
1245
1245
  }
@@ -1294,7 +1294,7 @@ module.exports = class WirelessSensor{
1294
1294
  return this.config_send(sensor_mac, packet);
1295
1295
  }
1296
1296
  config_set_reset_timeout_108(sensor_mac, value){
1297
- console.log('config_set_deactivate_activate_accelero_108');
1297
+ console.log('config_set_reset_timeout_108');
1298
1298
  var packet = [244, 49, 0, 0, 0];
1299
1299
  let timeout = int2Bytes((value), 2);
1300
1300
  packet.push(...timeout);
@@ -1309,7 +1309,7 @@ module.exports = class WirelessSensor{
1309
1309
  }
1310
1310
  config_set_quality_of_service_108(sensor_mac, value){
1311
1311
  console.log('config_set_quality_of_service_108');
1312
- var packet = [244, 52, 0, 0, 0, value]
1312
+ var packet = [244, 52, 0, 0, 0, value];
1313
1313
  console.log(packet);
1314
1314
  return this.config_send(sensor_mac, packet);
1315
1315
  }
@@ -1328,28 +1328,42 @@ module.exports = class WirelessSensor{
1328
1328
  }
1329
1329
  config_set_shift_one_108(sensor_mac, hours, minutes){
1330
1330
  console.log('config_set_shift_one_108');
1331
- var packet = [244, 47, 0, 0, 0, 0, hours, minutes]
1331
+ var packet = [244, 47, 0, 0, 0, 0, hours, minutes];
1332
1332
  console.log(packet);
1333
1333
  return this.config_send(sensor_mac, packet);
1334
1334
  }
1335
1335
  config_set_shift_two_108(sensor_mac, hours, minutes){
1336
1336
  console.log('config_set_shift_two_108');
1337
- var packet = [244, 47, 0, 0, 0, 1, hours, minutes]
1337
+ var packet = [244, 47, 0, 0, 0, 1, hours, minutes];
1338
1338
  console.log(packet);
1339
1339
  return this.config_send(sensor_mac, packet);
1340
1340
  }
1341
1341
  config_set_shift_three_108(sensor_mac, hours, minutes){
1342
1342
  console.log('config_set_shift_three_108');
1343
- var packet = [244, 47, 0, 0, 0, 2, hours, minutes]
1343
+ var packet = [244, 47, 0, 0, 0, 2, hours, minutes];
1344
1344
  console.log(packet);
1345
1345
  return this.config_send(sensor_mac, packet);
1346
1346
  }
1347
1347
  config_set_shift_four_108(sensor_mac, hours, minutes){
1348
1348
  console.log('config_set_shift_four_108');
1349
- var packet = [244, 47, 0, 0, 0, 3, hours, minutes]
1349
+ var packet = [244, 47, 0, 0, 0, 3, hours, minutes];
1350
1350
  console.log(packet);
1351
1351
  return this.config_send(sensor_mac, packet);
1352
1352
  }
1353
+ config_set_fly_interval_108(sensor_mac, value){
1354
+ console.log('config_set_fly_interval_108');
1355
+ var packet = [247, 56, 0, 0, 0];
1356
+ let val = int2Bytes((value), 2);
1357
+ packet.push(...val);
1358
+ console.log(packet);
1359
+ return this.config_send(sensor_mac, packet);
1360
+ }
1361
+ config_set_sample_rate_108(sensor_mac, value){
1362
+ console.log('config_set_sample_rate_108');
1363
+ var packet = [244, 57, 0, 0, 0, value];
1364
+ console.log(packet);
1365
+ return this.config_send(sensor_mac, packet, {}, 6000);
1366
+ }
1353
1367
  config_set_sensor_boot_time_420ma(sensor_mac, value){
1354
1368
  console.log('sensor_boot_time_420ma');
1355
1369
  var packet = [244, 68, 0, 0, 45, value];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ncd-io/node-red-enterprise-sensors",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wireless.html CHANGED
@@ -690,7 +690,13 @@
690
690
 
691
691
  tare_the_scale_217: {value:0},
692
692
  weight_calib_217_active: {value: ""},
693
- weight_calib_217: {value: 0}
693
+ weight_calib_217: {value: 0},
694
+
695
+ fly_interval_108_active: {value: ""},
696
+ fly_interval_108: {value: 0},
697
+
698
+ sample_rate_108_active: {value: ""},
699
+ sample_rate_108: {value: 0}
694
700
  },
695
701
  inputs: 0,
696
702
  outputs: 1,
@@ -2834,6 +2840,46 @@
2834
2840
  <input type="checkbox" id="node-input-rtc_108" value="1">
2835
2841
  </div>
2836
2842
  </div>
2843
+ <div class="form-row ncd-active-check">
2844
+ <strong>Set FLY Interval</strong>
2845
+ <div>
2846
+ <label for="node-input-fly_interval_108_active">Active:</label>
2847
+ <input type="checkbox" id="node-input-fly_interval_108_active" class="ncd-config-toggle" data-target-id="node-input-fly_interval_108" value="1">
2848
+ </div>
2849
+ <div>
2850
+ <label for="node-input-fly_interval_108"><i class="icon-tag"></i>Value:</label>
2851
+ <select id="node-input-fly_interval_108">
2852
+ <option value="60">1 Hour</option>
2853
+ <option value="120">2 Hours</option>
2854
+ <option value="240">4 Hours</option>
2855
+ <option value="480">8 Hours</option>
2856
+ <option value="720">12 Hours</option>
2857
+ <option value="1080">18 Hours</option>
2858
+ <option value="1440">24 Hours</option>
2859
+ </select>
2860
+ </div>
2861
+ </div>
2862
+ <div class="form-row ncd-active-check">
2863
+ <strong>Set Sample Rate</strong>
2864
+ <p class="caption">
2865
+ Only applies to sensor with firmware version 8 and above.
2866
+ </p>
2867
+ <div>
2868
+ <label for="node-input-sample_rate_108_active">Active:</label>
2869
+ <input type="checkbox" id="node-input-sample_rate_108_active" class="ncd-config-toggle" data-target-id="node-input-sample_rate_108" value="1">
2870
+ </div>
2871
+ <div>
2872
+ <label for="node-input-sample_rate_108"><i class="icon-tag"></i>Value:</label>
2873
+ <select id="node-input-sample_rate_108">
2874
+ <option value="0">10 Hz</option>
2875
+ <option value="1">20 Hz</option>
2876
+ <option value="2">50 Hz</option>
2877
+ <option value="3">100 Hz</option>
2878
+ <option value="4">200 Hz</option>
2879
+ <option value="5">400 Hz</option>
2880
+ </select>
2881
+ </div>
2882
+ </div>
2837
2883
  </div>
2838
2884
  <div class="ncd-dependent" data-sensor-35 data-sensor-36>
2839
2885
  <hr>
package/wireless.js CHANGED
@@ -1959,6 +1959,12 @@ module.exports = function(RED) {
1959
1959
  if(config.quality_of_service_108_active){
1960
1960
  promises.quality_of_service_108 = node.config_gateway.config_set_quality_of_service_108(mac, parseInt(config.quality_of_service_108));
1961
1961
  }
1962
+ if(config.fly_interval_108_active){
1963
+ promises.fly_interval_108 = node.config_gateway.config_set_fly_interval_108(mac, parseInt(config.fly_interval_108));
1964
+ }
1965
+ if(config.sample_rate_108_active){
1966
+ promises.sample_rate_108 = node.config_gateway.config_set_sample_rate_108(mac, parseInt(config.sample_rate_108));
1967
+ }
1962
1968
  break;
1963
1969
  case 110:
1964
1970
  if(config.odr_p1_110_active){