Rixed multiplying message bug.

This commit is contained in:
2025-06-16 17:52:31 +02:00
parent 3ba98d2362
commit c8c588600c
2 changed files with 13 additions and 5 deletions

View File

@@ -28,12 +28,17 @@ module.exports = function(RED) {
);
node.on('input', function(msg, send, done) {
let toggleUpdate = false;
switch (msg.topic) {
case "clock":
reactor.updateState(msg.timestamp);
toggleUpdate = true;
break;
case "Fluent":
reactor.setInfluent = msg;
if (msg.payload.inlet == 0) {
toggleUpdate = true;
}
break;
case "OTR":
reactor.setOTR = msg;
@@ -42,7 +47,10 @@ module.exports = function(RED) {
console.log("Unknown topic: " + msg.topic);
}
send(reactor.getEffluent);
if (toggleUpdate) {
reactor.updateState(msg.timestamp);
send(reactor.getEffluent);
}
if (done) {
done();