Hi There,
I was looking through the code base of knxEasy node - which hasn't been touched in five years, so I don't know whether it's being maintained.
I was looking at the server-side code for the knxEasy-in node:
module.exports = function (RED) {
function knxEasyIn(config) {
RED.nodes.createNode(this, config)
var node = this
... initialiisation code remove ....
if (node.server) {
if (node.topic) {
node.server.register("in", node)
}
}
}
RED.nodes.registerType("knxEasy-in", knxEasyIn)
}
What interested me was the node.server.register("in", node)
which registers the nodes configuration with a central listener for knx events.
That configuration is provided in the editor panel and is basically the group address and datapoint type:
Here my confusion: my understanding is that if this configuration is modified in the editor, then registerType isn't called on the server, i.e. the register block above isn't executed again to update the central knx listener via the node.server.register
function.
So when does the code registered with the RED.nodes.registerType
function get called when:
- a node is added to the workspace? - Yes I would say.
- a flow is deployed or rather a node is updated by a deploy? - Yes or no - I'm not sure?
- when I update the parameters of the node in the editor? No I would say.
- When Node-RED restarts/starts? - Yes I would say.
The point of this is that if I update the knxEasy-in node in the editor, do those changes even take affect on the server? Or better said, when do they take affect...
I did have a quick skim of the docu and that would seem to imply the code is only called once the node is dragged onto the workspace - which also implies on start or restarts of flows.
Perhaps I'm imagining all this and the knxEasy-in node works fine (I can't test it since I don't have a knx product)