Do not send 'switching profile applied to line' notification; Handle nok,ok,offline node status

This commit is contained in:
rasta5man 2025-01-09 14:55:53 +01:00
parent c052887a1f
commit 63504df84d
2 changed files with 277 additions and 363 deletions

View file

@ -1591,26 +1591,34 @@ exports.install = function(instance) {
} }
} }
//TODO -> status offline for rvo if rotary_switch_state is OFF let contactorStatus = 1;
//let relayStatus = 1; if(relaysData[line] != undefined) contactorStatus = relaysData[line].contactor;
//if (relaysData[line] != undefined) {
// relayStatus = relaysData[line].contactor;
//}
if (line == 0 || contactorStatus == 0) {
interval = setInterval(runTasks, LONG_INTERVAL);
return;
}
//if (line == 0) relayStatus = 0; // TODO: -> status offline for rvo if rotary_switch_state is OFF, this is source of errors
//if (type == "cmd-terminal") relayStatus = 1; //
// let relayStatus = 1;
// if (relaysData[line] != undefined) {
// relayStatus = relaysData[line].contactor;
// }
//check if rotary_switch_state == "Off" // if (line == 0) relayStatus = 0;
//if (relayStatus == 0) { // if (type == "cmd-terminal") relayStatus = 1;
//console.log("------------------------------------relayStatus", relayStatus, line);
//let values = { "status": "OFFLINE" };
//if(tbname) sendTelemetry(values, tbname) // //check if rotary_switch_state == "Off"
// if (relayStatus == 0) {
// console.log("------------------------------------relayStatus", relayStatus, line);
// let values = { "status": "OFFLINE" };
//interval = setInterval(runTasks, SHORT_INTERVAL); // if(tbname) sendTelemetry(values, tbname)
//return;
//} // interval = setInterval(runTasks, SHORT_INTERVAL);
// return;
// }
if (!rsPort.isOpen) { if (!rsPort.isOpen) {
interval = setInterval(runTasks, LONG_INTERVAL); interval = setInterval(runTasks, LONG_INTERVAL);
@ -1806,7 +1814,7 @@ exports.install = function(instance) {
} }
else { else {
if(currentTask.debug) { if (currentTask.debug) {
// currentTask.timestamp <= currentTimestamp && logger.debug("currentTask is not processed - task is in the future", currentTask); // currentTask.timestamp <= currentTimestamp && logger.debug("currentTask is not processed - task is in the future", currentTask);
} }
@ -1845,10 +1853,10 @@ exports.install = function(instance) {
delete cmdCounter[node]; delete cmdCounter[node];
logger.debug("profil nebol úspešne odoslaný na node č. ", params); logger.debug("profil nebol úspešne odoslaný na node č. ", params);
if(!nodeProfileSendFail.has(node)) { if (!nodeProfileSendFail.has(node)) {
sendNotification("CMD Manager: process cmd", tbName, "configuration_of_dimming_profile_to_node_failed", { node: node }, "", SEND_TO.tb, instance); sendNotification("CMD Manager: process cmd", tbName, "configuration_of_dimming_profile_to_node_failed", { node: node }, "", SEND_TO.tb, instance);
nodeProfileSendFail.add(node); nodeProfileSendFail.add(node);
} }
} }
if (itIsNodeCommand) { if (itIsNodeCommand) {

File diff suppressed because it is too large Load diff