Fixed bugs and hard coded config for now.

This commit is contained in:
2025-06-12 16:56:28 +02:00
parent 2182bed343
commit 91482c564d
4 changed files with 37 additions and 18 deletions

View File

@@ -5,9 +5,18 @@ module.exports = function(RED) {
let name = config.name;
node.on('input', function(msg) {
msg.payload = msg.payload.toLowerCase();
node.send(msg);
const Reactor = require('./dependencies/reactor_class');
const reactor = new Reactor(Array(13).fill(0.001));
node.on('input', function(msg, send, done) {
if (msg.topic == "clock") {
reactor.updateState(msg);
}
if (done) {
done();
}
});
}
RED.nodes.registerType("advanced-reactor", reactor);