mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add use strict to mqtt node, allow will parm to be passed.
This commit is contained in:
parent
1d5e8de6f6
commit
7ad28de52a
@ -15,7 +15,7 @@
|
||||
**/
|
||||
|
||||
module.exports = function(RED) {
|
||||
|
||||
"use strict";
|
||||
var connectionPool = require("./lib/mqttConnectionPool");
|
||||
var util = require("util");
|
||||
|
||||
@ -151,4 +151,3 @@ module.exports = function(RED) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ function matchTopic(ts,t) {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
get: function(broker,port,clientid,username,password) {
|
||||
get: function(broker,port,clientid,username,password,will) {
|
||||
var id = "["+(username||"")+":"+(password||"")+"]["+(clientid||"")+"]@"+broker+":"+port;
|
||||
if (!connections[id]) {
|
||||
connections[id] = function() {
|
||||
@ -40,6 +40,7 @@ module.exports = {
|
||||
options.clientId = clientid || 'mqtt_' + (1+Math.random()*4294967295).toString(16);
|
||||
options.username = username;
|
||||
options.password = password;
|
||||
options.will = will;
|
||||
var queue = [];
|
||||
var subscriptions = [];
|
||||
var connecting = false;
|
||||
@ -125,4 +126,3 @@ module.exports = {
|
||||
return connections[id];
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user