same than mine :) coded exactly like you while I was on the plane I just pushed but not tested (sadly I pushed it on my master :-/)
https://github.com/lgmorand/MMM-Ratp
socketNotificationReceived: function(notification, payload) {
Log.info("Notif:" + notification);
if (notification === "TRANSPORTS") {
if (this.config.debugging) {
Log.info("Transports received");
Log.info(payload.lineInfo);
Log.info(payload.transports);
}
if(this.config.uniqueID == payload.uniqueID) // just in case of multi instances
{
this.transports = payload.transports;
this.lineInfo = payload.lineInfo;
this.loaded = true;
this.updateDom(this.config.animationSpeed);
}
}
At least, thanks to you, I know it can work :)
my idea to improve it was to auto-generate a ID for the module, not in the config, but generated by the Magic Mirror on loading. it should be easy to implement. Once this ID generated, it is accessible from the node_helper and the module.js. this way, no need to declare a uniqueID in the config