@ncd-io/node-red-enterprise-sensors 2.0.3 → 2.0.4

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/wireless.js CHANGED
@@ -1861,6 +1861,9 @@ module.exports = function(RED) {
1861
1861
  if(config.pressure_sensor_range_AMS5915_21_active){
1862
1862
  promises.pressure_sensor_range_AMS5915_21 = node.config_gateway.config_set_pressure_sensor_range_21(mac, parseInt(config.pressure_sensor_range_AMS5915_21));
1863
1863
  }
1864
+ if(config.pressure_sensor_range_AMS5935_21_active){
1865
+ promises.pressure_sensor_range_AMS5935_21 = node.config_gateway.config_set_pressure_sensor_range_21(mac, parseInt(config.pressure_sensor_range_AMS5935_21));
1866
+ }
1864
1867
  break;
1865
1868
  case 23:
1866
1869
  if(config.thermocouple_type_23_active){
@@ -2177,11 +2180,20 @@ module.exports = function(RED) {
2177
2180
  }
2178
2181
  break;
2179
2182
  case 47:
2180
- if(config.roll_angle_threshold_47_active){
2181
- promises.roll_angle_threshold_47 = node.config_gateway.config_set_roll_threshold_47(mac, parseInt(config.roll_angle_threshold_47));
2183
+ // if(config.roll_angle_threshold_47_active){
2184
+ // promises.roll_angle_threshold_47 = node.config_gateway.config_set_roll_threshold_47(mac, parseInt(config.roll_angle_threshold_47));
2185
+ // }
2186
+ // if(config.pitch_angle_threshold_47_active){
2187
+ // promises.pitch_angle_threshold_47 = node.config_gateway.config_set_pitch_threshold_47(mac, parseInt(config.pitch_angle_threshold_47));
2188
+ // }
2189
+ if(config.tilt_mode_47_active){
2190
+ promises.tilt_mode_47 = node.config_gateway.config_set_tilt_mode_47(mac, parseInt(config.tilt_mode_47));
2182
2191
  }
2183
- if(config.pitch_angle_threshold_47_active){
2184
- promises.pitch_angle_threshold_47 = node.config_gateway.config_set_pitch_threshold_47(mac, parseInt(config.pitch_angle_threshold_47));
2192
+ if(config.tilt_angle_47_active){
2193
+ promises.tilt_angle_47 = node.config_gateway.config_set_tilt_angle_47(mac, parseInt(config.tilt_angle_47));
2194
+ }
2195
+ if(config.tilt_timer_47_active){
2196
+ promises.tilt_timer_47 = node.config_gateway.config_set_tilt_timer_47(mac, parseInt(config.tilt_timer_47));
2185
2197
  }
2186
2198
  break;
2187
2199
  case 48:
@@ -2924,18 +2936,21 @@ module.exports = function(RED) {
2924
2936
  if(config.high_calibration_420ma_active){
2925
2937
  promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
2926
2938
  }
2927
- if(config.auto_check_interval_88_active){
2928
- promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
2929
- }
2930
- if(config.auto_check_threshold_88_active){
2931
- promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
2932
- }
2933
2939
  if(config.fsr_420ma_active){
2934
2940
  promises.fsr_420ma = node.config_gateway.config_set_fsr_420ma(mac, parseInt(config.fsr_420ma));
2935
2941
  }
2936
2942
  if(config.always_on_420ma_active){
2937
2943
  promises.always_on_420ma = node.config_gateway.config_set_always_on_420ma(mac, parseInt(config.always_on_420ma));
2938
2944
  }
2945
+ if(config.lube_on_time_1_105_active){
2946
+ promises.lube_on_time_1_105 = node.config_gateway.config_set_lube_on_time_1_105(mac, parseInt(config.lube_on_time_1_105));
2947
+ }
2948
+ if(config.faulty_level_105_active){
2949
+ promises.faulty_level_105 = node.config_gateway.config_set_faulty_level_105(mac, parseInt(config.faulty_level_105));
2950
+ }
2951
+ if(config.friction_level_105_active){
2952
+ promises.friction_level_105 = node.config_gateway.config_set_friction_level_105(mac, parseInt(config.friction_level_105));
2953
+ }
2939
2954
  break;
2940
2955
  case 106:
2941
2956
  if(config.sensor_boot_time_420ma_active){
@@ -2950,18 +2965,24 @@ module.exports = function(RED) {
2950
2965
  if(config.high_calibration_420ma_active){
2951
2966
  promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
2952
2967
  }
2953
- if(config.auto_check_interval_88_active){
2954
- promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
2955
- }
2956
- if(config.auto_check_threshold_88_active){
2957
- promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
2958
- }
2959
2968
  if(config.fsr_420ma_active){
2960
2969
  promises.fsr_420ma = node.config_gateway.config_set_fsr_420ma(mac, parseInt(config.fsr_420ma));
2961
2970
  }
2962
2971
  if(config.always_on_420ma_active){
2963
2972
  promises.always_on_420ma = node.config_gateway.config_set_always_on_420ma(mac, parseInt(config.always_on_420ma));
2964
2973
  }
2974
+ if(config.lube_on_time_1_105_active){
2975
+ promises.lube_on_time_1_105 = node.config_gateway.config_set_lube_on_time_1_105(mac, parseInt(config.lube_on_time_1_105));
2976
+ }
2977
+ if(config.lube_on_time_2_105_active){
2978
+ promises.lube_on_time_2_105 = node.config_gateway.config_set_lube_on_time_2_105(mac, parseInt(config.lube_on_time_2_105));
2979
+ }
2980
+ if(config.faulty_level_105_active){
2981
+ promises.faulty_level_105 = node.config_gateway.config_set_faulty_level_105(mac, parseInt(config.faulty_level_105));
2982
+ }
2983
+ if(config.friction_level_105_active){
2984
+ promises.friction_level_105 = node.config_gateway.config_set_friction_level_105(mac, parseInt(config.friction_level_105));
2985
+ }
2965
2986
  break;
2966
2987
  case 107:
2967
2988
  if(config.sensor_boot_time_420ma_active){
@@ -3413,6 +3434,14 @@ module.exports = function(RED) {
3413
3434
  promises.max_num_motion_tx_delay_114 = node.config_gateway.config_set_max_num_motion_tx_delay_110(mac, parseInt(config.max_num_motion_tx_delay_110));
3414
3435
  }
3415
3436
  break;
3437
+ case 115:
3438
+ if(config.vibration_mode_115_active){
3439
+ promises.vibration_mode_115 = node.config_gateway.config_set_vibration_mode_115(mac, parseInt(config.vibration_mode_115));
3440
+ }
3441
+ if(config.offset_mode_115_active){
3442
+ promises.offset_mode_115 = node.config_gateway.config_set_offset_mode_115(mac, parseInt(config.offset_mode_115));
3443
+ }
3444
+ break;
3416
3445
  case 118:
3417
3446
  if(config.pressure_sensor_fs_ch1_118_active){
3418
3447
  promises.pressure_sensor_fs_ch1_118 = node.config_gateway.config_set_pressure_sensor_fs_ch1_118(mac, parseInt(config.pressure_sensor_fs_ch1_118));
@@ -4052,12 +4081,12 @@ module.exports = function(RED) {
4052
4081
  if(config.flow_dev_addr_536_active){
4053
4082
  promises.flow_dev_addr_536 = node.config_gateway.config_set_flow_dev_addr_536(mac, parseInt(config.flow_addr_1_536), parseInt(config.flow_addr_2_536), parseInt(config.flow_addr_3_536), parseInt(config.flow_addr_4_536));
4054
4083
  }
4055
- if(config.oxygen_rate_536_active){
4056
- promises.oxygen_rate_536 = node.config_gateway.config_set_oxygen_rate_536(mac, parseInt(config.oxygen_rate_536));
4057
- }
4058
- if(config.oxygen_timeout_536_active){
4059
- promises.oxygen_timeout_536 = node.config_gateway.config_set_oxygen_timeout_536(mac, parseInt(config.oxygen_timeout_536));
4060
- }
4084
+ // if(config.oxygen_rate_536_active){
4085
+ // promises.oxygen_rate_536 = node.config_gateway.config_set_oxygen_rate_536(mac, parseInt(config.oxygen_rate_536));
4086
+ // }
4087
+ // if(config.oxygen_timeout_536_active){
4088
+ // promises.oxygen_timeout_536 = node.config_gateway.config_set_oxygen_timeout_536(mac, parseInt(config.oxygen_timeout_536));
4089
+ // }
4061
4090
  if(config.oxygen_max_threshold_s1_536_active){
4062
4091
  promises.oxygen_max_threshold_s1_536 = node.config_gateway.config_set_oxygen_max_threshold_s1_536(mac, parseInt(config.oxygen_max_threshold_s1_536));
4063
4092
  }
@@ -4082,6 +4111,24 @@ module.exports = function(RED) {
4082
4111
  if(config.oxygen_min_threshold_s4_536_active){
4083
4112
  promises.oxygen_min_threshold_s4_536 = node.config_gateway.config_set_oxygen_min_threshold_s4_536(mac, parseInt(config.oxygen_min_threshold_s4_536));
4084
4113
  }
4114
+ if(config.flow_sensor_baud_rate_536_active){
4115
+ promises.flow_sensor_baud_rate_536 = node.config_gateway.config_set_flow_sensor_baud_rate_536(mac, parseInt(config.flow_sensor_baud_rate_536));
4116
+ }
4117
+ if(config.oxygen_sensor_baud_rate_536_active){
4118
+ promises.oxygen_sensor_baud_rate_536 = node.config_gateway.config_set_oxygen_sensor_baud_rate_536(mac, parseInt(config.oxygen_sensor_baud_rate_536));
4119
+ }
4120
+ if(config.flow_sensor_parity_bits_536_active){
4121
+ promises.flow_sensor_parity_bits_536 = node.config_gateway.config_set_flow_sensor_parity_bits_536(mac, parseInt(config.flow_sensor_parity_bits_536));
4122
+ }
4123
+ if(config.oxygen_sensor_parity_bits_536_active){
4124
+ promises.oxygen_sensor_parity_bits_536 = node.config_gateway.config_set_oxygen_sensor_parity_bits_536(mac, parseInt(config.oxygen_sensor_parity_bits_536));
4125
+ }
4126
+ if(config.flow_sensor_stop_bits_536_active){
4127
+ promises.flow_sensor_stop_bits_536 = node.config_gateway.config_set_flow_sensor_stop_bits_536(mac, parseInt(config.flow_sensor_stop_bits_536));
4128
+ }
4129
+ if(config.oxygen_sensor_stop_bits_536_active){
4130
+ promises.oxygen_sensor_stop_bits_536 = node.config_gateway.config_set_oxygen_sensor_stop_bits_536(mac, parseInt(config.oxygen_sensor_stop_bits_536));
4131
+ }
4085
4132
  break;
4086
4133
  case 537:
4087
4134
  if(config.output_data_rate_101_active){
@@ -4385,6 +4432,9 @@ module.exports = function(RED) {
4385
4432
  if(config.rx485_timeout_1011_active){
4386
4433
  promises.rx485_timeout_1010 = node.config_gateway.config_set_rx485_timeout_1011(mac, parseInt(config.rx485_timeout_1011));
4387
4434
  }
4435
+ if(config.mode_1011_active){
4436
+ promises.mode_1010 = node.config_gateway.config_set_mode_1011(mac, parseInt(config.mode_1011));
4437
+ }
4388
4438
  if(config.auto_address_timeout_1011_active){
4389
4439
  promises.auto_address_timeout_1010 = node.config_gateway.config_set_auto_address_timeout_1011(mac, parseInt(config.auto_address_timeout_1011));
4390
4440
  }
@@ -4527,10 +4577,14 @@ module.exports = function(RED) {
4527
4577
  console.log(html_map);
4528
4578
 
4529
4579
  let update_flag = false;
4580
+ let reboot = false;
4530
4581
  for(let key in html_map){
4531
4582
  if(html_map[key].html_value != node.gateway_node.sensor_configs[data.payload.address].reported_configs[key]){
4532
4583
  // console.log('Comparing ' + html_map[key].html_value + ' to ' + node.gateway_node.sensor_configs[data.payload.address].reported_configs[key]);
4533
4584
  // console.log('Value is different, updating config for ' + key);
4585
+ if(key == 'network_id'){
4586
+ reboot = true;
4587
+ }
4534
4588
  update_flag = true;
4535
4589
  break;
4536
4590
  }
@@ -4548,6 +4602,16 @@ module.exports = function(RED) {
4548
4602
  }, 20000);
4549
4603
  promises.send_sync_configs = this.config_gateway.send_sync_config_wireless_node(data, html_map, node.gateway_node.sensor_configs[data.payload.address]);
4550
4604
 
4605
+ let original_otf_devices = [53, 80, 81, 82, 83, 84, 87, 101, 102, 103, 110, 111, 112, 114, 117, 180, 181, 518, 519, 520, 538];
4606
+ if(reboot){
4607
+ promises.reboot_sensor = node.gateway.config_reboot_sensor(data.payload.address);
4608
+ } else {
4609
+ if(original_otf_devices.includes(data.payload.sensor_type)){
4610
+ promises.exit_otn_mode = node.gateway.config_exit_otn_mode(data.payload.address);
4611
+ }else{
4612
+ promises.config_exit_otn_mode_common = node.gateway.config_exit_otn_mode_common(data.payload.address);
4613
+ }
4614
+ }
4551
4615
  promises.finish = new Promise((fulfill, reject) => {
4552
4616
  node.config_gateway.queue.add(() => {
4553
4617
  return new Promise((f, r) => {