@ncd-io/node-red-enterprise-sensors 1.0.5 → 1.0.7
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 +402 -32
- package/package.json +1 -1
- package/wireless.html +568 -48
- package/wireless.js +115 -2
package/wireless.js
CHANGED
|
@@ -54,9 +54,17 @@ module.exports = function(RED) {
|
|
|
54
54
|
this.gateway.digi.report_rssi = config.rssi;
|
|
55
55
|
|
|
56
56
|
if(config.comm_type == 'serial'){
|
|
57
|
-
|
|
57
|
+
if(config.port !== ''){
|
|
58
|
+
setTimeout(()=>{node.gateway.digi.serial.setupSerial()}, 5000);
|
|
59
|
+
}else{
|
|
60
|
+
node.warn('No Port Selected for Serial Communications.')
|
|
61
|
+
}
|
|
58
62
|
}else{
|
|
59
|
-
|
|
63
|
+
if(config.tcp_port === '' || config.ip_address === ''){
|
|
64
|
+
node.warn('TCP Socket not configured for Network Communications. Please enter a Port and IP Address.');
|
|
65
|
+
}else{
|
|
66
|
+
setTimeout(()=>{node.gateway.digi.serial.setupClient()}, 5000);
|
|
67
|
+
}
|
|
60
68
|
}
|
|
61
69
|
node.gateway.digi.serial.on('ready', () => {
|
|
62
70
|
node.gateway.digi.send.at_command('SL').then((res) => {
|
|
@@ -868,6 +876,12 @@ module.exports = function(RED) {
|
|
|
868
876
|
promises.current_calibration_13 = node.config_gateway.config_set_current_calibration_13(mac, cali);
|
|
869
877
|
}
|
|
870
878
|
}
|
|
879
|
+
// if(config.current_calibration_13_dep_active){
|
|
880
|
+
// var cali = parseInt(config.current_calibration_13_dep);
|
|
881
|
+
// if(cali != 0){
|
|
882
|
+
// promises.current_calibration_13_dep = node.config_gateway.config_set_current_calibration_13_dep(mac, cali);
|
|
883
|
+
// }
|
|
884
|
+
// }
|
|
871
885
|
if(config.change_detection_t3_active){
|
|
872
886
|
promises.change_detection = node.config_gateway.config_set_change_detection(mac, config.change_enabled ? 1 : 0, parseInt(config.change_pr), parseInt(config.change_interval));
|
|
873
887
|
}
|
|
@@ -899,6 +913,18 @@ module.exports = function(RED) {
|
|
|
899
913
|
promises.current_calibration_ch2_19 = node.config_gateway.config_set_current_calibration_ch2_19(mac, cali);
|
|
900
914
|
}
|
|
901
915
|
}
|
|
916
|
+
// if(config.current_calibration_13_dep_active){
|
|
917
|
+
// var cali = parseInt(config.current_calibration_13_dep);
|
|
918
|
+
// if(cali != 0){
|
|
919
|
+
// promises.current_calibration_13_dep = node.config_gateway.config_set_current_calibration_13_dep(mac, cali);
|
|
920
|
+
// }
|
|
921
|
+
// }
|
|
922
|
+
// if(config.current_calibration_ch2_19_dep_active){
|
|
923
|
+
// var cali = parseInt(config.current_calibration_ch2_19_dep);
|
|
924
|
+
// if(cali != 0){
|
|
925
|
+
// promises.current_calibration_ch2_19_dep = node.config_gateway.config_set_current_calibration_ch2_19_dep(mac, cali);
|
|
926
|
+
// }
|
|
927
|
+
// }
|
|
902
928
|
break;
|
|
903
929
|
case 23:
|
|
904
930
|
if(config.thermocouple_type_23_active){
|
|
@@ -953,7 +979,51 @@ module.exports = function(RED) {
|
|
|
953
979
|
promises.current_calibration_ch3_28 = node.config_gateway.config_set_current_calibration_ch3_28(mac, cali);
|
|
954
980
|
}
|
|
955
981
|
}
|
|
982
|
+
// if(config.current_calibration_13_dep_active){
|
|
983
|
+
// var cali = parseInt(config.current_calibration_13_dep);
|
|
984
|
+
// if(cali != 0){
|
|
985
|
+
// promises.current_calibration_13_dep = node.config_gateway.config_set_current_calibration_13_dep(mac, cali);
|
|
986
|
+
// }
|
|
987
|
+
// }
|
|
988
|
+
// if(config.current_calibration_ch2_19_dep_active){
|
|
989
|
+
// var cali = parseInt(config.current_calibration_ch2_19_dep);
|
|
990
|
+
// if(cali != 0){
|
|
991
|
+
// promises.current_calibration_ch2_19_dep = node.config_gateway.config_set_current_calibration_ch2_19_dep(mac, cali);
|
|
992
|
+
// }
|
|
993
|
+
// }
|
|
994
|
+
// if(config.current_calibration_ch3_28_dep_active){
|
|
995
|
+
// var cali = parseInt(config.current_calibration_ch3_28_dep);
|
|
996
|
+
// if(cali != 0){
|
|
997
|
+
// promises.current_calibration_ch3_28_dep = node.config_gateway.config_set_current_calibration_ch3_28_dep(mac, cali);
|
|
998
|
+
// }
|
|
999
|
+
// }
|
|
1000
|
+
if(config.change_detection_t3_active){
|
|
1001
|
+
promises.change_detection = node.config_gateway.config_set_change_detection(mac, config.change_enabled ? 1 : 0, parseInt(config.change_pr), parseInt(config.change_interval));
|
|
1002
|
+
}
|
|
1003
|
+
if(config.change_detection_ch2_active){
|
|
1004
|
+
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));
|
|
1005
|
+
}
|
|
1006
|
+
if(config.change_detection_ch3_active){
|
|
1007
|
+
promises.change_detection_ch3 = node.config_gateway.config_set_change_detection_ch3(mac, config.change_enabled_ch3 ? 1 : 0, parseInt(config.change_pr_ch3), parseInt(config.change_interval_ch3));
|
|
1008
|
+
}
|
|
956
1009
|
break;
|
|
1010
|
+
case 33:
|
|
1011
|
+
if(config.clear_counter_33){
|
|
1012
|
+
promises.clear_counter_33 = node.config_gateway.config_set_clear_counter_33(mac);
|
|
1013
|
+
}
|
|
1014
|
+
if(config.input_two_108_active){
|
|
1015
|
+
promises.input_two_108 = node.config_gateway.config_set_input_two_108(mac, parseInt(config.input_two_108));
|
|
1016
|
+
}
|
|
1017
|
+
if(config.counter_threshold_108_active){
|
|
1018
|
+
promises.counter_threshold_108 = node.config_gateway.config_set_counter_threshold_108(mac, parseInt(config.counter_threshold_108));
|
|
1019
|
+
}
|
|
1020
|
+
if(config.debounce_time_108_active){
|
|
1021
|
+
promises.debounce_time_108 = node.config_gateway.config_set_debounce_time_108(mac, parseInt(config.debounce_time_108));
|
|
1022
|
+
}
|
|
1023
|
+
if(config.push_notification_33_active){
|
|
1024
|
+
promises.push_notification_33 = node.config_gateway.config_set_push_notification_33(mac, parseInt(config.push_notification_33));
|
|
1025
|
+
}
|
|
1026
|
+
break;
|
|
957
1027
|
case 35:
|
|
958
1028
|
if(config.counter_threshold_35_active){
|
|
959
1029
|
promises.config_set_counter_threshold_35 = node.config_gateway.config_set_counter_threshold_35(mac, parseInt(config.counter_threshold_35));
|
|
@@ -1044,6 +1114,17 @@ module.exports = function(RED) {
|
|
|
1044
1114
|
promises.sensor_boot_time_420ma = node.config_gateway.config_set_sensor_boot_time_420ma(mac, parseInt(config.sensor_boot_time_420ma));
|
|
1045
1115
|
}
|
|
1046
1116
|
break;
|
|
1117
|
+
case 58:
|
|
1118
|
+
if(config.calibration_58){
|
|
1119
|
+
promises.calibration_58 = node.config_gateway.config_set_calibration_58(mac);
|
|
1120
|
+
}
|
|
1121
|
+
if(config.factory_reset_tank_probe_58){
|
|
1122
|
+
promises.factory_reset_tank_probe_58 = node.config_gateway.config_set_factory_reset_tank_probe_58(mac);
|
|
1123
|
+
}
|
|
1124
|
+
if(config.set_max_range_58_active){
|
|
1125
|
+
promises.set_max_range_58 = node.config_gateway.config_set_max_range_58(mac, parseInt(config.set_max_range_58));
|
|
1126
|
+
}
|
|
1127
|
+
break;
|
|
1047
1128
|
case 76:
|
|
1048
1129
|
if(config.periodic_check_rate_76_active){
|
|
1049
1130
|
promises.periodic_check_rate_76 = node.config_gateway.config_set_periodic_check_rate_76(mac, parseInt(config.periodic_check_rate_76));
|
|
@@ -1412,6 +1493,9 @@ module.exports = function(RED) {
|
|
|
1412
1493
|
if(config.counter_threshold_108_active){
|
|
1413
1494
|
promises.counter_threshold_108 = node.config_gateway.config_set_counter_threshold_108(mac, parseInt(config.counter_threshold_108));
|
|
1414
1495
|
}
|
|
1496
|
+
if(config.push_notification_108_active){
|
|
1497
|
+
promises.push_notification_108 = node.config_gateway.config_set_push_notification_108(mac, parseInt(config.push_notification_108));
|
|
1498
|
+
}
|
|
1415
1499
|
break;
|
|
1416
1500
|
case 110:
|
|
1417
1501
|
if(config.current_calibration_c1_80_active){
|
|
@@ -1877,6 +1961,11 @@ module.exports = function(RED) {
|
|
|
1877
1961
|
promises.set_rtc_101 = node.config_gateway.config_set_rtc_101(mac);
|
|
1878
1962
|
}
|
|
1879
1963
|
break;
|
|
1964
|
+
case 531:
|
|
1965
|
+
if(config.mode_531_active){
|
|
1966
|
+
promises.mode_531 = node.config_gateway.config_set_operation_mode_531(mac, parseInt(config.mode_531));
|
|
1967
|
+
}
|
|
1968
|
+
break;
|
|
1880
1969
|
case 535:
|
|
1881
1970
|
if(config.force_calibration_co2_535_active){
|
|
1882
1971
|
promises.force_calibration_co2_535 = node.config_gateway.config_set_sensor_forced_calibration_535(mac);
|
|
@@ -2007,6 +2096,12 @@ module.exports = function(RED) {
|
|
|
2007
2096
|
if(config.sub_device_type_539_active){
|
|
2008
2097
|
promises.sub_device_type_539 = node.config_gateway.config_set_sub_device_type_539(mac, parseInt(config.sub_device_type_539));
|
|
2009
2098
|
}
|
|
2099
|
+
if(config.number_of_read_retries_539_active){
|
|
2100
|
+
promises.number_of_read_retries_539 = node.config_gateway.config_set_number_of_read_retries_539(mac, parseInt(config.number_of_read_retries_539));
|
|
2101
|
+
}
|
|
2102
|
+
if(config.read_parameter_539_active){
|
|
2103
|
+
promises.read_parameter_539 = node.config_gateway.config_set_read_parameter_539(mac, parseInt(config.read_parameter_539));
|
|
2104
|
+
}
|
|
2010
2105
|
if(config.number_of_regs_to_rd_539_active){
|
|
2011
2106
|
let register_array = [];
|
|
2012
2107
|
for(let ind = 0; ind < config.number_of_regs_to_rd_539; ind++){
|
|
@@ -2053,6 +2148,15 @@ module.exports = function(RED) {
|
|
|
2053
2148
|
if(config.rx_timeout_539_active){
|
|
2054
2149
|
promises.rx_timeout_539 = node.config_gateway.config_set_rx_timeout_539(mac, parseInt(config.rx_timeout_539));
|
|
2055
2150
|
}
|
|
2151
|
+
if(config.stop_bit_1011_active){
|
|
2152
|
+
promises.stop_bit_1011 = node.config_gateway.config_set_stop_bit_1011(mac, parseInt(config.stop_bit_1011));
|
|
2153
|
+
}
|
|
2154
|
+
if(config.set_parity_1011_active){
|
|
2155
|
+
promises.set_parity_1011 = node.config_gateway.config_set_set_parity_1011(mac, parseInt(config.set_parity_1011));
|
|
2156
|
+
}
|
|
2157
|
+
if(config.reboot_1011){
|
|
2158
|
+
promises.reboot_1011 = node.config_gateway.config_set_reboot_1011(mac);
|
|
2159
|
+
}
|
|
2056
2160
|
break;
|
|
2057
2161
|
case 1011:
|
|
2058
2162
|
if(config.stay_on_mode_539_active){
|
|
@@ -2070,6 +2174,15 @@ module.exports = function(RED) {
|
|
|
2070
2174
|
if(config.auto_address_timeout_1011_active){
|
|
2071
2175
|
promises.auto_address_timeout_1011 = node.config_gateway.config_set_auto_address_timeout_1011(mac, parseInt(config.auto_address_timeout_1011));
|
|
2072
2176
|
}
|
|
2177
|
+
if(config.stop_bit_1011_active){
|
|
2178
|
+
promises.stop_bit_1011 = node.config_gateway.config_set_stop_bit_1011(mac, parseInt(config.stop_bit_1011));
|
|
2179
|
+
}
|
|
2180
|
+
if(config.set_parity_1011_active){
|
|
2181
|
+
promises.set_parity_1011 = node.config_gateway.config_set_parity_1011(mac, parseInt(config.set_parity_1011));
|
|
2182
|
+
}
|
|
2183
|
+
if(config.reboot_1011){
|
|
2184
|
+
promises.reboot_1011 = node.config_gateway.config_set_reboot_1011(mac);
|
|
2185
|
+
}
|
|
2073
2186
|
break;
|
|
2074
2187
|
}
|
|
2075
2188
|
}
|