Updated my home automation system to this latest beta. The update process went very smoothly, just one node type I had to add afterwards (feedparse)
Everything started fine but shortly after I realized I had some stuff not working. It was my "solution" for keeping track of system statuses. Took some while until I found the reason why I was punished...
I had the following typical code in some function nodes:
if (msg.method === "turnon"){
msg.payload = "carport turnon";
node.send(msg);
msg.payload = "facade entrance turnon";
node.send(msg);
msg.payload = "facade washroom turnon";
node.send(msg);
msg.payload = "facade garden turnon";
node.send(msg);
}
if (msg.method === "turnoff"){
msg.payload = "carport turnoff";
node.send(msg);
msg.payload = "facade entrance turnoff";
node.send(msg);
msg.payload = "facade washroom turnoff";
node.send(msg);
msg.payload = "facade garden turnoff";
node.send(msg);
}
This did work fine in the old version but not in the new. I modified the code like this and now everything looks ok. I assume this is a typical example of the difference, when asynchronous the msg.payload is updated faster and BEFORE all node.send commands have had enough time to be executed. Somehow.
if (msg.method === "turnon"){
node.send({ payload:"facade washroom turnon" });
node.send({ payload:"carport turnon" });
node.send({ payload:"facade entrance turnon" });
node.send({ payload:"facade garden turnon" });
}
if (msg.method === "turnoff"){
node.send({ payload:"facade washroom turnoff" });
node.send({ payload:"carport turnoff" });
node.send({ payload:"facade entrance turnoff" });
node.send({ payload:"facade garden turnoff" });
}