1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Ensure MQTT node cleansession/keepalive defaults are used

This commit is contained in:
Nick O'Leary 2015-09-01 22:58:26 +01:00
parent fa5e37993e
commit c33d02c53f
2 changed files with 6 additions and 1 deletions

View File

@ -240,6 +240,10 @@
label: this._("mqtt.tabs-label.will") label: this._("mqtt.tabs-label.will")
}); });
setTimeout(function() { tabs.resize()},0); setTimeout(function() { tabs.resize()},0);
if (typeof this.cleansession === 'undefined') {
this.cleansession = true;
$("#node-config-input-cleansession").prop("checked",true);
}
if (typeof this.usetls === 'undefined'){ if (typeof this.usetls === 'undefined'){
this.usetls = false; this.usetls = false;
$("#node-config-input-usetls").prop("checked",false); $("#node-config-input-usetls").prop("checked",false);
@ -254,6 +258,7 @@
} }
if (typeof this.keepalive === 'undefined'){ if (typeof this.keepalive === 'undefined'){
this.keepalive = 15; this.keepalive = 15;
$("#node-config-input-keepalive").val(this.keepalive);
} }
function updateTLSOptions() { function updateTLSOptions() {

View File

@ -103,7 +103,7 @@ module.exports = function(RED) {
this.options.username = this.username; this.options.username = this.username;
this.options.password = this.password; this.options.password = this.password;
this.options.keepalive = this.keepalive; this.options.keepalive = this.keepalive;
this.options.clean = this.clean; this.options.clean = this.cleansession;
this.options.reconnectPeriod = RED.settings.mqttReconnectTime||5000; this.options.reconnectPeriod = RED.settings.mqttReconnectTime||5000;
if (this.compatmode == "true" || this.compatmode === true){ if (this.compatmode == "true" || this.compatmode === true){
this.options.protocolId = 'MQIsdp'; this.options.protocolId = 'MQIsdp';