diff --git a/arduino-iot-client-mqtt/arduino-iot-client-mqtt.js b/arduino-iot-client-mqtt/arduino-iot-client-mqtt.js index edd9759..cd92d5e 100644 --- a/arduino-iot-client-mqtt/arduino-iot-client-mqtt.js +++ b/arduino-iot-client-mqtt/arduino-iot-client-mqtt.js @@ -230,7 +230,7 @@ class ArduinoClientMqtt { } async reconnect() { - await this.connection.reconnect(); + this.connection.reconnect(); }; async updateToken(token) { @@ -241,7 +241,7 @@ class ArduinoClientMqtt { try { if (this.connection) { // Disconnect to the connection that is using the old token - await this.connection.end(); + this.connection.end(); // Remove the connection this.connection = null; @@ -627,6 +627,9 @@ class ArduinoClientMqtt { node=nodeId; } const propOutputTopic = `/a/t/${thingId}/e/o`; + if (!this.propertyCallback[propOutputTopic] || !this.propertyCallback[propOutputTopic][name]) { + return Promise.resolve(this.numSubscriptions); + } var pos=-1; for(var i=0; i { const connection = $("#node-input-connection").val(); const organization = $("#node-input-organization").val(); - this.organization = organization; + if (connection === "_ADD_") { $("#node-input-organization").empty(); str = this._("arduino-iot-cloud.config.connection.placeholders.no-conn-selected"); $("").appendTo("#node-input-thing"); $("#node-input-thing").trigger("change"); - } else { + } + if (this.organization != organization) { + this.organization = organization; $("select#node-input-thing").empty(); initThings(connection, this._, null, organization); } @@ -424,6 +427,10 @@ +
+ + +
+
+ + +
+
+ + +
+
+ + +