@ncd-io/node-red-enterprise-sensors 1.0.11 → 1.1.1
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/lib/WirelessGateway.js +717 -79
- package/package.json +2 -2
- package/wireless.html +393 -60
- package/wireless.js +401 -62
package/wireless.js
CHANGED
|
@@ -41,7 +41,14 @@ module.exports = function(RED) {
|
|
|
41
41
|
if(!config.ip_address){
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
if(!config.tcp_inactive_timeout){
|
|
45
|
+
config.tcp_inactive_timeout = 1200;
|
|
46
|
+
}
|
|
47
|
+
if(config.tcp_inactive_timeout_active){
|
|
48
|
+
var comm = new comms.NcdTCP(config.ip_address, this.port, false, parseInt(config.tcp_inactive_timeout));
|
|
49
|
+
}else{
|
|
50
|
+
var comm = new comms.NcdTCP(config.ip_address, this.port, false, false);
|
|
51
|
+
}
|
|
45
52
|
comm._emitter.on('error', (err) => {
|
|
46
53
|
console.log('tcp init error', err);
|
|
47
54
|
});
|
|
@@ -327,6 +334,9 @@ module.exports = function(RED) {
|
|
|
327
334
|
this._gateway_node.open_comms();
|
|
328
335
|
this.gateway = this._gateway_node.gateway;
|
|
329
336
|
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
330
340
|
var node = this;
|
|
331
341
|
|
|
332
342
|
node.on('close', function(){
|
|
@@ -344,6 +354,15 @@ module.exports = function(RED) {
|
|
|
344
354
|
node.set_status = function(){
|
|
345
355
|
node.status(statuses[node._gateway_node.is_config]);
|
|
346
356
|
};
|
|
357
|
+
node.temp_send_1024 = function(frame){
|
|
358
|
+
console.log('TODO - Move to Emitter');
|
|
359
|
+
node.send({
|
|
360
|
+
topic: "remote_at_response",
|
|
361
|
+
payload: frame,
|
|
362
|
+
time: Date.now()
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
|
|
347
366
|
node._gateway_node.on('send_manifest', (manifest_data) => {
|
|
348
367
|
node.send({
|
|
349
368
|
topic: 'sensor_manifest',
|
|
@@ -559,6 +578,9 @@ module.exports = function(RED) {
|
|
|
559
578
|
// 'address': "00:13:a2:00:42:2c:d2:aa"
|
|
560
579
|
// }
|
|
561
580
|
break;
|
|
581
|
+
case "remote_at_send":
|
|
582
|
+
node.gateway.remote_at_send(msg.payload.address, msg.payload.parameter, msg.payload.value, msg.payload.options).then(node.temp_send_1024, console.log).catch(console.log);
|
|
583
|
+
break;
|
|
562
584
|
default:
|
|
563
585
|
const byteArrayToHexString = byteArray => Array.from(msg.payload.address, byte => ('0' + (byte & 0xFF).toString(16)).slice(-2)).join('');
|
|
564
586
|
node.gateway.control_send(msg.payload.address, msg.payload.data, msg.payload.options).then().catch(console.log);
|
|
@@ -656,7 +678,8 @@ module.exports = function(RED) {
|
|
|
656
678
|
// OFF: {fill:"green",shape:"dot",text:"OFF Recieved, OTF Configuration Completed"}
|
|
657
679
|
FLY: {fill:"yellow",shape:"ring",text:"FLY"},
|
|
658
680
|
OTN: {fill:"yellow",shape:"ring",text:"OTN Received, Config Entered"},
|
|
659
|
-
OTF: {fill:"green",shape:"dot",text:"OTF Received, Config Complete"}
|
|
681
|
+
OTF: {fill:"green",shape:"dot",text:"OTF Received, Config Complete"},
|
|
682
|
+
UPTHWRN: {fill:"yellow",shape:"ring",text:"Threshold is low"}
|
|
660
683
|
};
|
|
661
684
|
var events = {};
|
|
662
685
|
var pgm_events = {};
|
|
@@ -679,7 +702,7 @@ module.exports = function(RED) {
|
|
|
679
702
|
|
|
680
703
|
var promises = {};
|
|
681
704
|
// This command is used for OTF on types 53, 80,81,82,83,84, 101, 102, 110, 111, 518, 519
|
|
682
|
-
let original_otf_devices = [53, 80, 81, 82, 83, 84, 101, 102, 110, 111, 112, 114, 180, 181, 518, 519, 520, 538];
|
|
705
|
+
let original_otf_devices = [53, 80, 81, 82, 83, 84, 97, 98, 101, 102, 110, 111, 112, 114, 180, 181, 518, 519, 520, 538];
|
|
683
706
|
if(original_otf_devices.includes(sensor.type)){
|
|
684
707
|
// This command is used for OTF on types 53, 80, 81, 82, 83, 84, 101, 102, 110, 111, 518, 519
|
|
685
708
|
promises.config_enter_otn_mode = node.config_gateway.config_enter_otn_mode(sensor.mac);
|
|
@@ -836,6 +859,26 @@ module.exports = function(RED) {
|
|
|
836
859
|
promises.change_detection = node.config_gateway.config_set_change_detection(mac, config.change_enabled ? 1 : 0, parseInt(config.change_pr), parseInt(config.change_interval));
|
|
837
860
|
}
|
|
838
861
|
break;
|
|
862
|
+
case 4:
|
|
863
|
+
if(config.thermocouple_type_23_active){
|
|
864
|
+
promises.thermocouple_type_4 = node.config_gateway.config_set_thermocouple_type_23(mac, parseInt(config.thermocouple_type_23));
|
|
865
|
+
}
|
|
866
|
+
if(config.filter_thermocouple_active){
|
|
867
|
+
promises.filter_thermocouple_4 = node.config_gateway.config_set_filter_thermocouple(mac, parseInt(config.filter_thermocouple));
|
|
868
|
+
}
|
|
869
|
+
if(config.cold_junction_thermocouple_active){
|
|
870
|
+
promises.cold_junction_thermocouple_4 = node.config_gateway.config_set_cold_junction_thermocouple(mac, parseInt(config.cold_junction_thermocouple));
|
|
871
|
+
}
|
|
872
|
+
if(config.sample_resolution_thermocouple_active){
|
|
873
|
+
promises.sample_resolution_thermocouple_4 = node.config_gateway.config_set_sample_resolution_thermocouple(mac, parseInt(config.sample_resolution_thermocouple));
|
|
874
|
+
}
|
|
875
|
+
if(config.number_of_samples_thermocouple_active){
|
|
876
|
+
promises.number_of_samples_thermocouple_4 = node.config_gateway.config_set_number_of_samples_thermocouple(mac, parseInt(config.number_of_samples_thermocouple));
|
|
877
|
+
}
|
|
878
|
+
if(config.measurement_type_thermocouple_active){
|
|
879
|
+
promises.measurement_type_thermocouple_4 = node.config_gateway.config_set_measurement_type_thermocouple(mac, parseInt(config.measurement_type_thermocouple));
|
|
880
|
+
}
|
|
881
|
+
break;
|
|
839
882
|
case 5:
|
|
840
883
|
promises.acceleration_range = node.config_gateway.config_set_amgt_accel(mac, parseInt(config.amgt_accel));
|
|
841
884
|
promises.magnetometer_gain = node.config_gateway.config_set_amgt_magnet(mac, parseInt(config.amgt_mag));
|
|
@@ -870,6 +913,26 @@ module.exports = function(RED) {
|
|
|
870
913
|
promises.change_detection = node.config_gateway.config_set_change_detection(mac, config.change_enabled ? 1 : 0, parseInt(config.change_pr), parseInt(config.change_interval));
|
|
871
914
|
}
|
|
872
915
|
break;
|
|
916
|
+
case 12:
|
|
917
|
+
if(config.thermocouple_type_23_active){
|
|
918
|
+
promises.thermocouple_type_12 = node.config_gateway.config_set_thermocouple_type_23(mac, parseInt(config.thermocouple_type_23));
|
|
919
|
+
}
|
|
920
|
+
if(config.filter_thermocouple_active){
|
|
921
|
+
promises.filter_thermocouple_12 = node.config_gateway.config_set_filter_thermocouple(mac, parseInt(config.filter_thermocouple));
|
|
922
|
+
}
|
|
923
|
+
if(config.cold_junction_thermocouple_active){
|
|
924
|
+
promises.cold_junction_thermocouple_12 = node.config_gateway.config_set_cold_junction_thermocouple(mac, parseInt(config.cold_junction_thermocouple));
|
|
925
|
+
}
|
|
926
|
+
if(config.sample_resolution_thermocouple_active){
|
|
927
|
+
promises.sample_resolution_thermocouple_12 = node.config_gateway.config_set_sample_resolution_thermocouple(mac, parseInt(config.sample_resolution_thermocouple));
|
|
928
|
+
}
|
|
929
|
+
if(config.number_of_samples_thermocouple_active){
|
|
930
|
+
promises.number_of_samples_thermocouple_12 = node.config_gateway.config_set_number_of_samples_thermocouple(mac, parseInt(config.number_of_samples_thermocouple));
|
|
931
|
+
}
|
|
932
|
+
if(config.measurement_type_thermocouple_active){
|
|
933
|
+
promises.measurement_type_thermocouple_12 = node.config_gateway.config_set_measurement_type_thermocouple(mac, parseInt(config.measurement_type_thermocouple));
|
|
934
|
+
}
|
|
935
|
+
break;
|
|
873
936
|
case 13:
|
|
874
937
|
if(config.current_calibration_13_active){
|
|
875
938
|
var cali = parseInt(config.current_calibration_13);
|
|
@@ -900,6 +963,32 @@ module.exports = function(RED) {
|
|
|
900
963
|
if(config.high_calibration_420ma_active){
|
|
901
964
|
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
902
965
|
}
|
|
966
|
+
if(config.auto_check_interval_88_active){
|
|
967
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
968
|
+
}
|
|
969
|
+
if(config.auto_check_threshold_88_active){
|
|
970
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
971
|
+
}
|
|
972
|
+
break;
|
|
973
|
+
case 15:
|
|
974
|
+
if(config.sensor_boot_time_420ma_active){
|
|
975
|
+
promises.sensor_boot_time_420ma = node.config_gateway.config_set_sensor_boot_time_420ma(mac, parseInt(config.sensor_boot_time_420ma));
|
|
976
|
+
}
|
|
977
|
+
if(config.low_calibration_420ma_active){
|
|
978
|
+
promises.low_calibration_420ma = node.config_gateway.config_set_low_calibration_420ma(mac, parseInt(config.low_calibration_420ma));
|
|
979
|
+
}
|
|
980
|
+
if(config.mid_calibration_420ma_active){
|
|
981
|
+
promises.mid_calibration_420ma = node.config_gateway.config_set_mid_calibration_420ma(mac, parseInt(config.mid_calibration_420ma));
|
|
982
|
+
}
|
|
983
|
+
if(config.high_calibration_420ma_active){
|
|
984
|
+
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
985
|
+
}
|
|
986
|
+
if(config.auto_check_interval_88_active){
|
|
987
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
988
|
+
}
|
|
989
|
+
if(config.auto_check_threshold_88_active){
|
|
990
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
991
|
+
}
|
|
903
992
|
break;
|
|
904
993
|
case 19:
|
|
905
994
|
if(config.current_calibration_13_active){
|
|
@@ -926,11 +1015,33 @@ module.exports = function(RED) {
|
|
|
926
1015
|
// promises.current_calibration_ch2_19_dep = node.config_gateway.config_set_current_calibration_ch2_19_dep(mac, cali);
|
|
927
1016
|
// }
|
|
928
1017
|
// }
|
|
1018
|
+
if(config.change_detection_t3_active){
|
|
1019
|
+
promises.change_detection = node.config_gateway.config_set_change_detection(mac, config.change_enabled ? 1 : 0, parseInt(config.change_pr), parseInt(config.change_interval));
|
|
1020
|
+
}
|
|
1021
|
+
if(config.change_detection_ch2_active){
|
|
1022
|
+
promises.change_detection_ch2 = node.config_gateway.config_set_change_detection_ch2(mac, config.change_enabled_ch2 ? 1 : 0, parseInt(config.change_pr_ch2), parseInt(config.change_interval_ch2));
|
|
1023
|
+
}
|
|
929
1024
|
break;
|
|
930
1025
|
case 23:
|
|
931
1026
|
if(config.thermocouple_type_23_active){
|
|
932
1027
|
promises.thermocouple_type_23 = node.config_gateway.config_set_thermocouple_type_23(mac, parseInt(config.thermocouple_type_23));
|
|
933
1028
|
}
|
|
1029
|
+
if(config.filter_thermocouple_active){
|
|
1030
|
+
promises.filter_thermocouple_23 = node.config_gateway.config_set_filter_thermocouple(mac, parseInt(config.filter_thermocouple));
|
|
1031
|
+
}
|
|
1032
|
+
if(config.cold_junction_thermocouple_active){
|
|
1033
|
+
promises.cold_junction_thermocouple_23 = node.config_gateway.config_set_cold_junction_thermocouple(mac, parseInt(config.cold_junction_thermocouple));
|
|
1034
|
+
}
|
|
1035
|
+
if(config.sample_resolution_thermocouple_active){
|
|
1036
|
+
promises.sample_resolution_thermocouple_23 = node.config_gateway.config_set_sample_resolution_thermocouple(mac, parseInt(config.sample_resolution_thermocouple));
|
|
1037
|
+
}
|
|
1038
|
+
if(config.number_of_samples_thermocouple_active){
|
|
1039
|
+
promises.number_of_samples_thermocouple_23 = node.config_gateway.config_set_number_of_samples_thermocouple(mac, parseInt(config.number_of_samples_thermocouple));
|
|
1040
|
+
}
|
|
1041
|
+
if(config.measurement_type_thermocouple_active){
|
|
1042
|
+
promises.measurement_type_thermocouple_23 = node.config_gateway.config_set_measurement_type_thermocouple(mac, parseInt(config.measurement_type_thermocouple));
|
|
1043
|
+
}
|
|
1044
|
+
break;
|
|
934
1045
|
case 24:
|
|
935
1046
|
if(config.impact_accel_active){
|
|
936
1047
|
promises.impact_accel = node.config_gateway.config_set_acceleration_range_24(mac, parseInt(config.impact_accel));
|
|
@@ -946,6 +1057,7 @@ module.exports = function(RED) {
|
|
|
946
1057
|
}
|
|
947
1058
|
var interr = parseInt(config.activ_interr_x) | parseInt(config.activ_interr_y) | parseInt(config.activ_interr_z) | parseInt(config.activ_interr_op);
|
|
948
1059
|
promises.activity_interrupt = node.config_gateway.config_set_interrupt_24(mac, interr);
|
|
1060
|
+
break;
|
|
949
1061
|
case 25:
|
|
950
1062
|
if(config.impact_accel_active){
|
|
951
1063
|
promises.impact_accel = node.config_gateway.config_set_acceleration_range_24(mac, parseInt(config.impact_accel));
|
|
@@ -961,6 +1073,7 @@ module.exports = function(RED) {
|
|
|
961
1073
|
}
|
|
962
1074
|
var interr = parseInt(config.activ_interr_x) | parseInt(config.activ_interr_y) | parseInt(config.activ_interr_z) | parseInt(config.activ_interr_op);
|
|
963
1075
|
promises.activity_interrupt = node.config_gateway.config_set_interrupt_24(mac, interr);
|
|
1076
|
+
break;
|
|
964
1077
|
case 28:
|
|
965
1078
|
if(config.current_calibration_13_active){
|
|
966
1079
|
var cali = parseInt(config.current_calibration_13);
|
|
@@ -1012,15 +1125,6 @@ module.exports = function(RED) {
|
|
|
1012
1125
|
if(config.sps_skip_samples_32_active){
|
|
1013
1126
|
promises.sps_skip_samples_32 = node.config_gateway.config_set_sps_skip_samples_32(mac, parseInt(config.sps_skip_samples_32));
|
|
1014
1127
|
}
|
|
1015
|
-
if(config.stop_sampling){
|
|
1016
|
-
promises.stop_sampling = node.config_gateway.config_set_stop_sampling(mac);
|
|
1017
|
-
}
|
|
1018
|
-
if(config.extend_otf_timeout){
|
|
1019
|
-
promises.extend_otf_timeout = node.config_gateway.config_set_extend_otf_timeout(mac);
|
|
1020
|
-
}
|
|
1021
|
-
if(config.end_cfg){
|
|
1022
|
-
promises.end_cfg = node.config_gateway.config_set_end_cfg(mac);
|
|
1023
|
-
}
|
|
1024
1128
|
if(config.change_otf_interval_active){
|
|
1025
1129
|
promises.change_otf_interval = node.config_gateway.config_set_change_otf_interval(mac, parseInt(config.change_otf_interval));
|
|
1026
1130
|
}
|
|
@@ -1061,6 +1165,14 @@ module.exports = function(RED) {
|
|
|
1061
1165
|
promises.config_set_debounce_time_35 = node.config_gateway.config_set_debounce_time_35(mac, parseInt(config.debounce_time_2));
|
|
1062
1166
|
}
|
|
1063
1167
|
break;
|
|
1168
|
+
case 39:
|
|
1169
|
+
if(config.rtd_type_39_active){
|
|
1170
|
+
promises.rtd_type_39 = node.config_gateway.config_set_rtd_type_39(mac, parseInt(config.rtd_type_39));
|
|
1171
|
+
}
|
|
1172
|
+
if(config.rtd_range_39_active){
|
|
1173
|
+
promises.rtd_range_39 = node.config_gateway.config_set_rtd_range_39(mac, parseInt(config.rtd_range_39));
|
|
1174
|
+
}
|
|
1175
|
+
break;
|
|
1064
1176
|
case 40:
|
|
1065
1177
|
promises.filtering = node.config_gateway.config_set_filtering(mac, parseInt(config.filtering));
|
|
1066
1178
|
promises.data_rate = node.config_gateway.config_set_data_rate(mac, parseInt(config.data_rate));
|
|
@@ -1077,15 +1189,6 @@ module.exports = function(RED) {
|
|
|
1077
1189
|
if(config.scd_skip_samples_44_active){
|
|
1078
1190
|
promises.scd_skip_samples_44 = node.config_gateway.config_set_scd_skip_samples_44(mac, parseInt(config.scd_skip_samples_44));
|
|
1079
1191
|
}
|
|
1080
|
-
if(config.stop_sampling){
|
|
1081
|
-
promises.stop_sampling = node.config_gateway.config_set_stop_sampling(mac);
|
|
1082
|
-
}
|
|
1083
|
-
if(config.extend_otf_timeout){
|
|
1084
|
-
promises.extend_otf_timeout = node.config_gateway.config_set_extend_otf_timeout(mac);
|
|
1085
|
-
}
|
|
1086
|
-
if(config.end_cfg){
|
|
1087
|
-
promises.end_cfg = node.config_gateway.config_set_end_cfg(mac);
|
|
1088
|
-
}
|
|
1089
1192
|
if(config.change_otf_interval_active){
|
|
1090
1193
|
promises.change_otf_interval = node.config_gateway.config_set_change_otf_interval(mac, parseInt(config.change_otf_interval));
|
|
1091
1194
|
}
|
|
@@ -1106,6 +1209,12 @@ module.exports = function(RED) {
|
|
|
1106
1209
|
if(config.high_calibration_420ma_active){
|
|
1107
1210
|
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
1108
1211
|
}
|
|
1212
|
+
if(config.auto_check_interval_88_active){
|
|
1213
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
1214
|
+
}
|
|
1215
|
+
if(config.auto_check_threshold_88_active){
|
|
1216
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
1217
|
+
}
|
|
1109
1218
|
break;
|
|
1110
1219
|
case 46:
|
|
1111
1220
|
if(config.motion_threshold_46_active){
|
|
@@ -1133,6 +1242,12 @@ module.exports = function(RED) {
|
|
|
1133
1242
|
if(config.high_calibration_420ma_active){
|
|
1134
1243
|
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
1135
1244
|
}
|
|
1245
|
+
if(config.auto_check_interval_88_active){
|
|
1246
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
1247
|
+
}
|
|
1248
|
+
if(config.auto_check_threshold_88_active){
|
|
1249
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
1250
|
+
}
|
|
1136
1251
|
break;
|
|
1137
1252
|
case 52:
|
|
1138
1253
|
if(config.sensor_boot_time_420ma_active){
|
|
@@ -1147,20 +1262,17 @@ module.exports = function(RED) {
|
|
|
1147
1262
|
if(config.high_calibration_420ma_active){
|
|
1148
1263
|
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
1149
1264
|
}
|
|
1265
|
+
if(config.auto_check_interval_88_active){
|
|
1266
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
1267
|
+
}
|
|
1268
|
+
if(config.auto_check_threshold_88_active){
|
|
1269
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
1270
|
+
}
|
|
1150
1271
|
break;
|
|
1151
1272
|
case 53:
|
|
1152
1273
|
if(config.scd_skip_samples_44_active){
|
|
1153
1274
|
promises.scd_skip_samples_44 = node.config_gateway.config_set_scd_skip_samples_44(mac, parseInt(config.scd_skip_samples_44));
|
|
1154
1275
|
}
|
|
1155
|
-
if(config.stop_sampling){
|
|
1156
|
-
promises.stop_sampling = node.config_gateway.config_set_stop_sampling(mac);
|
|
1157
|
-
}
|
|
1158
|
-
if(config.extend_otf_timeout){
|
|
1159
|
-
promises.extend_otf_timeout = node.config_gateway.config_set_extend_otf_timeout(mac);
|
|
1160
|
-
}
|
|
1161
|
-
if(config.end_cfg){
|
|
1162
|
-
promises.end_cfg = node.config_gateway.config_set_end_cfg(mac);
|
|
1163
|
-
}
|
|
1164
1276
|
if(config.change_otf_interval_active){
|
|
1165
1277
|
promises.change_otf_interval = node.config_gateway.config_set_change_otf_interval(mac, parseInt(config.change_otf_interval));
|
|
1166
1278
|
}
|
|
@@ -1172,7 +1284,22 @@ module.exports = function(RED) {
|
|
|
1172
1284
|
if(config.sensor_boot_time_420ma_active){
|
|
1173
1285
|
promises.sensor_boot_time_420ma = node.config_gateway.config_set_sensor_boot_time_420ma(mac, parseInt(config.sensor_boot_time_420ma));
|
|
1174
1286
|
}
|
|
1175
|
-
|
|
1287
|
+
if(config.low_calibration_420ma_active){
|
|
1288
|
+
promises.low_calibration_420ma = node.config_gateway.config_set_low_calibration_420ma(mac, parseInt(config.low_calibration_420ma));
|
|
1289
|
+
}
|
|
1290
|
+
if(config.mid_calibration_420ma_active){
|
|
1291
|
+
promises.mid_calibration_420ma = node.config_gateway.config_set_mid_calibration_420ma(mac, parseInt(config.mid_calibration_420ma));
|
|
1292
|
+
}
|
|
1293
|
+
if(config.high_calibration_420ma_active){
|
|
1294
|
+
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
1295
|
+
}
|
|
1296
|
+
if(config.auto_check_interval_88_active){
|
|
1297
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
1298
|
+
}
|
|
1299
|
+
if(config.auto_check_threshold_88_active){
|
|
1300
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
1301
|
+
}
|
|
1302
|
+
break;
|
|
1176
1303
|
case 58:
|
|
1177
1304
|
if(config.calibration_58){
|
|
1178
1305
|
promises.calibration_58 = node.config_gateway.config_set_calibration_58(mac);
|
|
@@ -1183,7 +1310,15 @@ module.exports = function(RED) {
|
|
|
1183
1310
|
if(config.set_max_range_58_active){
|
|
1184
1311
|
promises.set_max_range_58 = node.config_gateway.config_set_max_range_58(mac, parseInt(config.set_max_range_58));
|
|
1185
1312
|
}
|
|
1186
|
-
|
|
1313
|
+
break;
|
|
1314
|
+
case 75:
|
|
1315
|
+
if(config.auto_check_interval_88_active){
|
|
1316
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
1317
|
+
}
|
|
1318
|
+
if(config.auto_check_threshold_88_active){
|
|
1319
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
1320
|
+
}
|
|
1321
|
+
break;
|
|
1187
1322
|
case 76:
|
|
1188
1323
|
if(config.periodic_check_rate_76_active){
|
|
1189
1324
|
promises.periodic_check_rate_76 = node.config_gateway.config_set_periodic_check_rate_76(mac, parseInt(config.periodic_check_rate_76));
|
|
@@ -1197,14 +1332,23 @@ module.exports = function(RED) {
|
|
|
1197
1332
|
if(config.alert_duration_76_active){
|
|
1198
1333
|
promises.alert_duration_76 = node.config_gateway.config_set_alert_duration_76(mac, parseInt(config.alert_duration_76));
|
|
1199
1334
|
}
|
|
1335
|
+
if(config.auto_check_interval_88_active){
|
|
1336
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
1337
|
+
}
|
|
1338
|
+
if(config.auto_check_threshold_88_active){
|
|
1339
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
1340
|
+
}
|
|
1341
|
+
break;
|
|
1200
1342
|
case 78:
|
|
1201
1343
|
if(config.sensor_boot_time_78_active){
|
|
1202
1344
|
promises.sensor_boot_time_78 = node.config_gateway.config_set_sensor_boot_time_78(mac, parseInt(config.sensor_boot_time_78));
|
|
1203
1345
|
}
|
|
1346
|
+
break;
|
|
1204
1347
|
case 79:
|
|
1205
1348
|
if(config.sensor_boot_time_78_active){
|
|
1206
1349
|
promises.sensor_boot_time_78 = node.config_gateway.config_set_sensor_boot_time_78(mac, parseInt(config.sensor_boot_time_78));
|
|
1207
1350
|
}
|
|
1351
|
+
break;
|
|
1208
1352
|
case 80:
|
|
1209
1353
|
if(config.output_data_rate_101_active){
|
|
1210
1354
|
promises.output_data_rate_101 = node.config_gateway.config_set_output_data_rate_101(mac, parseInt(config.output_data_rate_101));
|
|
@@ -1408,6 +1552,26 @@ module.exports = function(RED) {
|
|
|
1408
1552
|
promises.set_rtc_101 = node.config_gateway.config_set_rtc_101(mac);
|
|
1409
1553
|
}
|
|
1410
1554
|
break;
|
|
1555
|
+
case 85:
|
|
1556
|
+
if(config.sensor_boot_time_420ma_active){
|
|
1557
|
+
promises.sensor_boot_time_420ma = node.config_gateway.config_set_sensor_boot_time_420ma(mac, parseInt(config.sensor_boot_time_420ma));
|
|
1558
|
+
}
|
|
1559
|
+
if(config.low_calibration_420ma_active){
|
|
1560
|
+
promises.low_calibration_420ma = node.config_gateway.config_set_low_calibration_420ma(mac, parseInt(config.low_calibration_420ma));
|
|
1561
|
+
}
|
|
1562
|
+
if(config.mid_calibration_420ma_active){
|
|
1563
|
+
promises.mid_calibration_420ma = node.config_gateway.config_set_mid_calibration_420ma(mac, parseInt(config.mid_calibration_420ma));
|
|
1564
|
+
}
|
|
1565
|
+
if(config.high_calibration_420ma_active){
|
|
1566
|
+
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
1567
|
+
}
|
|
1568
|
+
if(config.auto_check_interval_88_active){
|
|
1569
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
1570
|
+
}
|
|
1571
|
+
if(config.auto_check_threshold_88_active){
|
|
1572
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
1573
|
+
}
|
|
1574
|
+
break;
|
|
1411
1575
|
case 88:
|
|
1412
1576
|
if(config.sensor_boot_time_420ma_active){
|
|
1413
1577
|
promises.sensor_boot_time_420ma = node.config_gateway.config_set_sensor_boot_time_420ma(mac, parseInt(config.sensor_boot_time_420ma));
|
|
@@ -1422,7 +1586,10 @@ module.exports = function(RED) {
|
|
|
1422
1586
|
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
1423
1587
|
}
|
|
1424
1588
|
if(config.auto_check_interval_88_active){
|
|
1425
|
-
promises.auto_check_interval_88 = node.config_gateway.
|
|
1589
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
1590
|
+
}
|
|
1591
|
+
if(config.auto_check_threshold_88_active){
|
|
1592
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
1426
1593
|
}
|
|
1427
1594
|
break;
|
|
1428
1595
|
case 89:
|
|
@@ -1439,7 +1606,30 @@ module.exports = function(RED) {
|
|
|
1439
1606
|
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
1440
1607
|
}
|
|
1441
1608
|
if(config.auto_check_interval_88_active){
|
|
1442
|
-
promises.auto_check_interval_88 = node.config_gateway.
|
|
1609
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
1610
|
+
}
|
|
1611
|
+
if(config.auto_check_threshold_88_active){
|
|
1612
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
1613
|
+
}
|
|
1614
|
+
break;
|
|
1615
|
+
case 90:
|
|
1616
|
+
if(config.sensor_boot_time_420ma_active){
|
|
1617
|
+
promises.sensor_boot_time_420ma = node.config_gateway.config_set_sensor_boot_time_420ma(mac, parseInt(config.sensor_boot_time_420ma));
|
|
1618
|
+
}
|
|
1619
|
+
if(config.low_calibration_420ma_active){
|
|
1620
|
+
promises.low_calibration_420ma = node.config_gateway.config_set_low_calibration_420ma(mac, parseInt(config.low_calibration_420ma));
|
|
1621
|
+
}
|
|
1622
|
+
if(config.mid_calibration_420ma_active){
|
|
1623
|
+
promises.mid_calibration_420ma = node.config_gateway.config_set_mid_calibration_420ma(mac, parseInt(config.mid_calibration_420ma));
|
|
1624
|
+
}
|
|
1625
|
+
if(config.high_calibration_420ma_active){
|
|
1626
|
+
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
1627
|
+
}
|
|
1628
|
+
if(config.auto_check_interval_88_active){
|
|
1629
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
1630
|
+
}
|
|
1631
|
+
if(config.auto_check_threshold_88_active){
|
|
1632
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
1443
1633
|
}
|
|
1444
1634
|
break;
|
|
1445
1635
|
case 91:
|
|
@@ -1447,6 +1637,92 @@ module.exports = function(RED) {
|
|
|
1447
1637
|
promises.sensor_boot_time_78 = node.config_gateway.config_set_sensor_boot_time_78(mac, parseInt(config.sensor_boot_time_78));
|
|
1448
1638
|
}
|
|
1449
1639
|
break;
|
|
1640
|
+
case 95:
|
|
1641
|
+
if(config.sensor_boot_time_420ma_active){
|
|
1642
|
+
promises.sensor_boot_time_420ma = node.config_gateway.config_set_sensor_boot_time_420ma(mac, parseInt(config.sensor_boot_time_420ma));
|
|
1643
|
+
}
|
|
1644
|
+
if(config.low_calibration_420ma_active){
|
|
1645
|
+
promises.low_calibration_420ma = node.config_gateway.config_set_low_calibration_420ma(mac, parseInt(config.low_calibration_420ma));
|
|
1646
|
+
}
|
|
1647
|
+
if(config.mid_calibration_420ma_active){
|
|
1648
|
+
promises.mid_calibration_420ma = node.config_gateway.config_set_mid_calibration_420ma(mac, parseInt(config.mid_calibration_420ma));
|
|
1649
|
+
}
|
|
1650
|
+
if(config.high_calibration_420ma_active){
|
|
1651
|
+
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
1652
|
+
}
|
|
1653
|
+
if(config.auto_check_interval_88_active){
|
|
1654
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
1655
|
+
}
|
|
1656
|
+
if(config.auto_check_threshold_88_active){
|
|
1657
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
1658
|
+
}
|
|
1659
|
+
break;
|
|
1660
|
+
case 96:
|
|
1661
|
+
if(config.sensor_boot_time_420ma_active){
|
|
1662
|
+
promises.sensor_boot_time_420ma = node.config_gateway.config_set_sensor_boot_time_420ma(mac, parseInt(config.sensor_boot_time_420ma));
|
|
1663
|
+
}
|
|
1664
|
+
if(config.low_calibration_420ma_active){
|
|
1665
|
+
promises.low_calibration_420ma = node.config_gateway.config_set_low_calibration_420ma(mac, parseInt(config.low_calibration_420ma));
|
|
1666
|
+
}
|
|
1667
|
+
if(config.mid_calibration_420ma_active){
|
|
1668
|
+
promises.mid_calibration_420ma = node.config_gateway.config_set_mid_calibration_420ma(mac, parseInt(config.mid_calibration_420ma));
|
|
1669
|
+
}
|
|
1670
|
+
if(config.high_calibration_420ma_active){
|
|
1671
|
+
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
1672
|
+
}
|
|
1673
|
+
if(config.auto_check_interval_88_active){
|
|
1674
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
1675
|
+
}
|
|
1676
|
+
if(config.auto_check_threshold_88_active){
|
|
1677
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
1678
|
+
}
|
|
1679
|
+
break;
|
|
1680
|
+
case 97:
|
|
1681
|
+
if(config.raw_length_97_active){
|
|
1682
|
+
promises.raw_length_97 = node.config_gateway.config_set_raw_length_97(mac, parseInt(config.raw_length_97));
|
|
1683
|
+
}
|
|
1684
|
+
if(config.raw_timeout_97_active){
|
|
1685
|
+
promises.raw_timeout_97 = node.config_gateway.config_set_raw_timeout_97(mac, parseInt(config.raw_timeout_97));
|
|
1686
|
+
}
|
|
1687
|
+
if(config.fly_rate_97_active){
|
|
1688
|
+
promises.fly_rate_97 = node.config_gateway.config_set_fly_rate_97(mac, parseInt(config.fly_rate_97));
|
|
1689
|
+
}
|
|
1690
|
+
if(config.boot_up_time_97_active){
|
|
1691
|
+
promises.boot_up_time_97 = node.config_gateway.config_set_boot_up_time_97(mac, parseInt(config.boot_up_time_97));
|
|
1692
|
+
}
|
|
1693
|
+
break;
|
|
1694
|
+
case 98:
|
|
1695
|
+
if(config.raw_length_97_active){
|
|
1696
|
+
promises.raw_length_97 = node.config_gateway.config_set_raw_length_97(mac, parseInt(config.raw_length_97));
|
|
1697
|
+
}
|
|
1698
|
+
if(config.raw_timeout_97_active){
|
|
1699
|
+
promises.raw_timeout_97 = node.config_gateway.config_set_raw_timeout_97(mac, parseInt(config.raw_timeout_97));
|
|
1700
|
+
}
|
|
1701
|
+
if(config.fly_rate_97_active){
|
|
1702
|
+
promises.fly_rate_97 = node.config_gateway.config_set_fly_rate_97(mac, parseInt(config.fly_rate_97));
|
|
1703
|
+
}
|
|
1704
|
+
if(config.boot_up_time_97_active){
|
|
1705
|
+
promises.boot_up_time_97 = node.config_gateway.config_set_boot_up_time_97(mac, parseInt(config.boot_up_time_97));
|
|
1706
|
+
}
|
|
1707
|
+
// if(config.sensor_boot_time_420ma_active){
|
|
1708
|
+
// promises.sensor_boot_time_420ma = node.config_gateway.config_set_sensor_boot_time_420ma(mac, parseInt(config.sensor_boot_time_420ma));
|
|
1709
|
+
// }
|
|
1710
|
+
// if(config.low_calibration_420ma_active){
|
|
1711
|
+
// promises.low_calibration_420ma = node.config_gateway.config_set_low_calibration_420ma(mac, parseInt(config.low_calibration_420ma));
|
|
1712
|
+
// }
|
|
1713
|
+
// if(config.mid_calibration_420ma_active){
|
|
1714
|
+
// promises.mid_calibration_420ma = node.config_gateway.config_set_mid_calibration_420ma(mac, parseInt(config.mid_calibration_420ma));
|
|
1715
|
+
// }
|
|
1716
|
+
// if(config.high_calibration_420ma_active){
|
|
1717
|
+
// promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
1718
|
+
// }
|
|
1719
|
+
// if(config.auto_check_interval_88_active){
|
|
1720
|
+
// promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
1721
|
+
// }
|
|
1722
|
+
// if(config.auto_check_threshold_88_active){
|
|
1723
|
+
// promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
1724
|
+
// }
|
|
1725
|
+
break;
|
|
1450
1726
|
case 101:
|
|
1451
1727
|
if(config.output_data_rate_101_m2_active){
|
|
1452
1728
|
promises.output_data_rate_101_m2 = node.config_gateway.config_set_output_data_rate_101(mac, parseInt(config.output_data_rate_101_m2));
|
|
@@ -1495,6 +1771,12 @@ module.exports = function(RED) {
|
|
|
1495
1771
|
if(config.high_calibration_420ma_active){
|
|
1496
1772
|
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
1497
1773
|
}
|
|
1774
|
+
if(config.auto_check_interval_88_active){
|
|
1775
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
1776
|
+
}
|
|
1777
|
+
if(config.auto_check_threshold_88_active){
|
|
1778
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
1779
|
+
}
|
|
1498
1780
|
break;
|
|
1499
1781
|
case 106:
|
|
1500
1782
|
if(config.sensor_boot_time_420ma_active){
|
|
@@ -1509,6 +1791,12 @@ module.exports = function(RED) {
|
|
|
1509
1791
|
if(config.high_calibration_420ma_active){
|
|
1510
1792
|
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
1511
1793
|
}
|
|
1794
|
+
if(config.auto_check_interval_88_active){
|
|
1795
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
1796
|
+
}
|
|
1797
|
+
if(config.auto_check_threshold_88_active){
|
|
1798
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
1799
|
+
}
|
|
1512
1800
|
break;
|
|
1513
1801
|
case 107:
|
|
1514
1802
|
if(config.sensor_boot_time_420ma_active){
|
|
@@ -1523,6 +1811,12 @@ module.exports = function(RED) {
|
|
|
1523
1811
|
if(config.high_calibration_420ma_active){
|
|
1524
1812
|
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
1525
1813
|
}
|
|
1814
|
+
if(config.auto_check_interval_88_active){
|
|
1815
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
1816
|
+
}
|
|
1817
|
+
if(config.auto_check_threshold_88_active){
|
|
1818
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
1819
|
+
}
|
|
1526
1820
|
break;
|
|
1527
1821
|
case 108:
|
|
1528
1822
|
if(config.accelerometer_state_108_active){
|
|
@@ -1552,9 +1846,6 @@ module.exports = function(RED) {
|
|
|
1552
1846
|
if(config.push_notification_108_active){
|
|
1553
1847
|
promises.push_notification_108 = node.config_gateway.config_set_push_notification_108(mac, parseInt(config.push_notification_108));
|
|
1554
1848
|
}
|
|
1555
|
-
if(config.qos_108_active){
|
|
1556
|
-
promises.qos_108 = node.config_gateway.config_set_qos_108(mac, parseInt(config.qos_108));
|
|
1557
|
-
}
|
|
1558
1849
|
if(config.deactivate_activate_accelero_108_active){
|
|
1559
1850
|
promises.deactivate_activate_accelero_108 = node.config_gateway.config_set_deactivate_activate_accelero_108(mac, parseInt(config.deactivate_activate_accelero_108));
|
|
1560
1851
|
}
|
|
@@ -1632,8 +1923,8 @@ module.exports = function(RED) {
|
|
|
1632
1923
|
if(config.auto_raw_destination_110_active){
|
|
1633
1924
|
promises.auto_raw_destination_110 = node.config_gateway.config_set_auto_raw_destination_110(mac, parseInt(config.auto_raw_destination_110, 16));
|
|
1634
1925
|
}
|
|
1635
|
-
if(config.
|
|
1636
|
-
promises.
|
|
1926
|
+
if(config.clear_probe_uptimers_110){
|
|
1927
|
+
promises.clear_probe_uptimers = node.config_gateway.config_set_clear_probe_uptimers_110(mac);
|
|
1637
1928
|
}
|
|
1638
1929
|
if(config.smart_interval_110_active){
|
|
1639
1930
|
promises.smart_interval_110 = node.config_gateway.config_set_smart_interval_110(mac, parseInt(config.smart_interval_110));
|
|
@@ -1706,8 +1997,8 @@ module.exports = function(RED) {
|
|
|
1706
1997
|
if(config.auto_raw_destination_110_active){
|
|
1707
1998
|
promises.auto_raw_destination_110 = node.config_gateway.config_set_auto_raw_destination_110(mac, parseInt(config.auto_raw_destination_110, 16));
|
|
1708
1999
|
}
|
|
1709
|
-
if(config.
|
|
1710
|
-
promises.
|
|
2000
|
+
if(config.clear_probe_uptimers_110){
|
|
2001
|
+
promises.clear_probe_uptimers = node.config_gateway.config_set_clear_probe_uptimers_110(mac);
|
|
1711
2002
|
}
|
|
1712
2003
|
if(config.smart_interval_110_active){
|
|
1713
2004
|
promises.smart_interval_110 = node.config_gateway.config_set_smart_interval_110(mac, parseInt(config.smart_interval_110));
|
|
@@ -1715,6 +2006,9 @@ module.exports = function(RED) {
|
|
|
1715
2006
|
if(config.smart_threshold_110_active){
|
|
1716
2007
|
promises.smart_threshold_110 = node.config_gateway.config_set_smart_threshold_110(mac, parseInt(config.smart_threshold_110));
|
|
1717
2008
|
}
|
|
2009
|
+
if(config.smart_threshold_p2_110_active){
|
|
2010
|
+
promises.smart_threshold_p2_110 = node.config_gateway.config_set_smart_threshold_p2_110(mac, parseInt(config.smart_threshold_p2_110));
|
|
2011
|
+
}
|
|
1718
2012
|
if(config.fly_interval_110_active){
|
|
1719
2013
|
promises.fly_interval_110 = node.config_gateway.config_set_fly_interval_110(mac, parseInt(config.fly_interval_110));
|
|
1720
2014
|
}
|
|
@@ -1771,8 +2065,8 @@ module.exports = function(RED) {
|
|
|
1771
2065
|
if(config.auto_raw_destination_110_active){
|
|
1772
2066
|
promises.auto_raw_destination_110 = node.config_gateway.config_set_auto_raw_destination_110(mac, parseInt(config.auto_raw_destination_110, 16));
|
|
1773
2067
|
}
|
|
1774
|
-
if(config.
|
|
1775
|
-
promises.
|
|
2068
|
+
if(config.clear_probe_uptimers_110){
|
|
2069
|
+
promises.clear_probe_uptimers = node.config_gateway.config_set_clear_probe_uptimers_110(mac);
|
|
1776
2070
|
}
|
|
1777
2071
|
if(config.smart_interval_110_active){
|
|
1778
2072
|
promises.smart_interval_110 = node.config_gateway.config_set_smart_interval_110(mac, parseInt(config.smart_interval_110));
|
|
@@ -1845,8 +2139,8 @@ module.exports = function(RED) {
|
|
|
1845
2139
|
if(config.auto_raw_destination_110_active){
|
|
1846
2140
|
promises.auto_raw_destination_110 = node.config_gateway.config_set_auto_raw_destination_110(mac, parseInt(config.auto_raw_destination_110, 16));
|
|
1847
2141
|
}
|
|
1848
|
-
if(config.
|
|
1849
|
-
promises.
|
|
2142
|
+
if(config.clear_probe_uptimers_110){
|
|
2143
|
+
promises.clear_probe_uptimers = node.config_gateway.config_set_clear_probe_uptimers_110(mac);
|
|
1850
2144
|
}
|
|
1851
2145
|
if(config.smart_interval_110_active){
|
|
1852
2146
|
promises.smart_interval_110 = node.config_gateway.config_set_smart_interval_110(mac, parseInt(config.smart_interval_110));
|
|
@@ -1858,6 +2152,23 @@ module.exports = function(RED) {
|
|
|
1858
2152
|
promises.fly_interval_110 = node.config_gateway.config_set_fly_interval_110(mac, parseInt(config.fly_interval_110));
|
|
1859
2153
|
}
|
|
1860
2154
|
break;
|
|
2155
|
+
case 118:
|
|
2156
|
+
if(config.pressure_sensor_fs_ch1_118_active){
|
|
2157
|
+
promises.pressure_sensor_fs_ch1_118 = node.config_gateway.config_set_pressure_sensor_fs_ch1_118(mac, parseInt(config.pressure_sensor_fs_ch1_118));
|
|
2158
|
+
}
|
|
2159
|
+
if(config.pressure_sensor_fs_ch2_118_active){
|
|
2160
|
+
promises.pressure_sensor_fs_ch2_118 = node.config_gateway.config_set_pressure_sensor_fs_ch2_118(mac, parseInt(config.pressure_sensor_fs_ch2_118));
|
|
2161
|
+
}
|
|
2162
|
+
if(config.auto_check_interval_118_active){
|
|
2163
|
+
promises.auto_check_interval_118 = node.config_gateway.config_set_auto_check_interval_118(mac, parseInt(config.auto_check_interval_118));
|
|
2164
|
+
}
|
|
2165
|
+
if(config.press_auto_check_percent_118_active){
|
|
2166
|
+
promises.press_auto_check_percent_118 = node.config_gateway.config_set_press_auto_check_percent_118(mac, parseInt(config.press_auto_check_percent_118));
|
|
2167
|
+
}
|
|
2168
|
+
if(config.temp_auto_check_percent_118_active){
|
|
2169
|
+
promises.temp_auto_check_percent_118 = node.config_gateway.config_set_temp_auto_check_percent_118(mac, parseInt(config.temp_auto_check_percent_118));
|
|
2170
|
+
}
|
|
2171
|
+
break;
|
|
1861
2172
|
case 180:
|
|
1862
2173
|
if(config.output_data_rate_101_active){
|
|
1863
2174
|
promises.output_data_rate_101 = node.config_gateway.config_set_output_data_rate_101(mac, parseInt(config.output_data_rate_101));
|
|
@@ -1976,6 +2287,9 @@ module.exports = function(RED) {
|
|
|
1976
2287
|
if(config.set_rtc_202){
|
|
1977
2288
|
promises.set_rtc_202 = node.config_gateway.config_set_rtc_202(mac);
|
|
1978
2289
|
}
|
|
2290
|
+
if(config.probe_boot_time_202_active){
|
|
2291
|
+
promises.probe_boot_time_202 = node.config_gateway.config_set_probe_boot_time_202(mac, parseInt(config.probe_boot_time_202));
|
|
2292
|
+
}
|
|
1979
2293
|
break;
|
|
1980
2294
|
case 505:
|
|
1981
2295
|
if(config.current_calibration_c1_80_active){
|
|
@@ -2169,6 +2483,12 @@ module.exports = function(RED) {
|
|
|
2169
2483
|
if(config.baudrate_539_active){
|
|
2170
2484
|
promises.baudrate_539 = node.config_gateway.config_set_baudrate_539(mac, parseInt(config.baudrate_539));
|
|
2171
2485
|
}
|
|
2486
|
+
if(config.stop_bit_1011_active){
|
|
2487
|
+
promises.stop_bit_1011 = node.config_gateway.config_set_stop_bit_1011(mac, parseInt(config.stop_bit_1011));
|
|
2488
|
+
}
|
|
2489
|
+
if(config.set_parity_1011_active){
|
|
2490
|
+
promises.set_parity_1011 = node.config_gateway.config_set_parity_1011(mac, parseInt(config.set_parity_1011));
|
|
2491
|
+
}
|
|
2172
2492
|
if(config.rx_timeout_539_active){
|
|
2173
2493
|
promises.rx_timeout_539 = node.config_gateway.config_set_rx_timeout_539(mac, parseInt(config.rx_timeout_539));
|
|
2174
2494
|
}
|
|
@@ -2208,19 +2528,11 @@ module.exports = function(RED) {
|
|
|
2208
2528
|
if(config.high_calibration_420ma_active){
|
|
2209
2529
|
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
2210
2530
|
}
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
if(config.sensor_boot_time_420ma_active){
|
|
2214
|
-
promises.sensor_boot_time_420ma = node.config_gateway.config_set_sensor_boot_time_420ma(mac, parseInt(config.sensor_boot_time_420ma));
|
|
2215
|
-
}
|
|
2216
|
-
if(config.low_calibration_420ma_active){
|
|
2217
|
-
promises.low_calibration_420ma = node.config_gateway.config_set_low_calibration_420ma(mac, parseInt(config.low_calibration_420ma));
|
|
2531
|
+
if(config.auto_check_interval_88_active){
|
|
2532
|
+
promises.auto_check_interval_88 = node.config_gateway.config_set_auto_check_interval_88(mac, parseInt(config.auto_check_interval_88));
|
|
2218
2533
|
}
|
|
2219
|
-
if(config.
|
|
2220
|
-
promises.
|
|
2221
|
-
}
|
|
2222
|
-
if(config.high_calibration_420ma_active){
|
|
2223
|
-
promises.high_calibration_420ma = node.config_gateway.config_set_high_calibration_420ma(mac, parseInt(config.high_calibration_420ma));
|
|
2534
|
+
if(config.auto_check_threshold_88_active){
|
|
2535
|
+
promises.auto_check_threshold_88 = node.config_gateway.config_set_auto_check_threshold_88(mac, parseInt(config.auto_check_threshold_88));
|
|
2224
2536
|
}
|
|
2225
2537
|
break;
|
|
2226
2538
|
case 1010:
|
|
@@ -2272,7 +2584,7 @@ module.exports = function(RED) {
|
|
|
2272
2584
|
}
|
|
2273
2585
|
}
|
|
2274
2586
|
// These sensors listed in original_otf_devices use a different OTF code.
|
|
2275
|
-
let original_otf_devices = [53, 80, 81, 82, 83, 84, 101, 102, 110, 111, 112, 114, 180, 181, 518, 519, 520, 538];
|
|
2587
|
+
let original_otf_devices = [53, 80, 81, 82, 83, 84, 97, 98, 101, 102, 110, 111, 112, 114, 180, 181, 518, 519, 520, 538];
|
|
2276
2588
|
// If we changed the network ID reboot the sensor to take effect.
|
|
2277
2589
|
// TODO if we add the encryption key command to node-red we need to reboot for it as well.
|
|
2278
2590
|
if(reboot){
|
|
@@ -2297,7 +2609,30 @@ module.exports = function(RED) {
|
|
|
2297
2609
|
for(var i in promises){
|
|
2298
2610
|
(function(name){
|
|
2299
2611
|
promises[name].then((f) => {
|
|
2300
|
-
if(name != 'finish')
|
|
2612
|
+
if(name != 'finish'){
|
|
2613
|
+
// console.log('IN PROMISE RESOLVE');
|
|
2614
|
+
// console.log(f);
|
|
2615
|
+
// success[name] = true;
|
|
2616
|
+
if(Object.hasOwn(f, 'result')){
|
|
2617
|
+
switch(f.result){
|
|
2618
|
+
case 255:
|
|
2619
|
+
success[name] = true;
|
|
2620
|
+
break;
|
|
2621
|
+
default:
|
|
2622
|
+
success[name] = {
|
|
2623
|
+
res: "Bad Response",
|
|
2624
|
+
result: f.result,
|
|
2625
|
+
sent: f.sent
|
|
2626
|
+
};
|
|
2627
|
+
}
|
|
2628
|
+
}else{
|
|
2629
|
+
success[name] = {
|
|
2630
|
+
res: "no result",
|
|
2631
|
+
result: null,
|
|
2632
|
+
sent: f.sent
|
|
2633
|
+
}
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2301
2636
|
else{
|
|
2302
2637
|
// #OTF
|
|
2303
2638
|
node.send({topic: 'Config Results', payload: success, time: Date.now(), addr: mac});
|
|
@@ -2380,9 +2715,13 @@ module.exports = function(RED) {
|
|
|
2380
2715
|
// _send_otn_request(sensor);
|
|
2381
2716
|
// Sensors having issues seeing OTN request sent too quickly
|
|
2382
2717
|
// Added timeout to fix issue
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
}
|
|
2718
|
+
if(config.sensor_type == 1010 || config.sensor_type == 1011){
|
|
2719
|
+
_config(sensor, true);
|
|
2720
|
+
}else{
|
|
2721
|
+
var tout = setTimeout(() => {
|
|
2722
|
+
_send_otn_request(sensor);
|
|
2723
|
+
}, 100);
|
|
2724
|
+
}
|
|
2386
2725
|
}else if(config.auto_config && config.on_the_fly_enable && sensor.mode == "OTN"){
|
|
2387
2726
|
if(config.sensor_type == 101 || config.sensor_type == 102 || config.sensor_type == 202){
|
|
2388
2727
|
if(this.gateway.hasOwnProperty('fly_101_in_progress') && this.gateway.fly_101_in_progress == false || !this.gateway.hasOwnProperty('fly_101_in_progress')){
|