codmpm / node-red-contrib-loxone

Connect the Loxone Miniserver to node-red via the Websocket API
MIT License
74 stars 24 forks source link

Race condition + fix #54

Closed sebastienfouss closed 4 years ago

sebastienfouss commented 4 years ago

Hi,

There seems to be a race condition in loxone.js, mostly visible when using node-red as a docker container.

More precisely, it might happen that a control command is sent (send_control_command) although the structure file has not been received yet by the node.

I would suggest to move the following lines:

node.connected = true;
node.setConnectionStatusMsg("green", "connected", "dot");
sendOnlineNodeMsg(true, config.id);

from client.on('authorized', function () { to client.on('get_structure_file', function (data) {

codmpm commented 4 years ago

Will be in 0.10.9

codmpm commented 4 years ago

0.10.9 published on npm, should be installable in the next minutes...