Revert trigger node fix

This commit is contained in:
Nick O'Leary 2024-10-21 16:24:21 +01:00
parent 892933ff75
commit d0ad62a82b
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -166,13 +166,7 @@ module.exports = function(RED) {
if (err) {
reject(err);
} else {
if (node.op1type === "date") {
let d = new Date();
if (node.op1 == "1") { msg.payload = Date.now(); }
else if (node.op1 == "iso") { msg.payload = d.toISOString(); }
else { msg.payload = d; }
}
else { msg.payload = value; }
msg.payload = value;
resolve();
}
});
@ -219,12 +213,7 @@ module.exports = function(RED) {
}
else {
msg2.payload = node.topics[topic].m2;
if (node.op2type === "date") {
let d = new Date();
if (node.op2 == "0") { msg2.payload = Date.now(); }
else if (node.op2 == "iso") { msg2.payload = d.toISOString(); }
else { msg2.payload = d; }
}
if (node.op2type === "date") { msg2.payload = Date.now(); }
if (node.second === true) { msgInfo.send([null,msg2]); }
else { msgInfo.send(msg2); }
}