mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Merge pull request #273 from hindessm/trivial-mqtt-var-cleanup
Trivial mqtt var cleanup
This commit is contained in:
		| @@ -77,7 +77,6 @@ module.exports = function(RED) { | |||||||
|         this.topic = n.topic; |         this.topic = n.topic; | ||||||
|         this.broker = n.broker; |         this.broker = n.broker; | ||||||
|         this.brokerConfig = RED.nodes.getNode(this.broker); |         this.brokerConfig = RED.nodes.getNode(this.broker); | ||||||
|         var node = this; |  | ||||||
|         if (this.brokerConfig) { |         if (this.brokerConfig) { | ||||||
|             this.status({fill:"red",shape:"ring",text:"disconnected"}); |             this.status({fill:"red",shape:"ring",text:"disconnected"}); | ||||||
|             this.client = connectionPool.get(this.brokerConfig.broker,this.brokerConfig.port,this.brokerConfig.clientid,this.brokerConfig.username,this.brokerConfig.password); |             this.client = connectionPool.get(this.brokerConfig.broker,this.brokerConfig.port,this.brokerConfig.clientid,this.brokerConfig.username,this.brokerConfig.password); | ||||||
| @@ -117,7 +116,6 @@ module.exports = function(RED) { | |||||||
|         this.broker = n.broker; |         this.broker = n.broker; | ||||||
|  |  | ||||||
|         this.brokerConfig = RED.nodes.getNode(this.broker); |         this.brokerConfig = RED.nodes.getNode(this.broker); | ||||||
|         var node = this; |  | ||||||
|  |  | ||||||
|         if (this.brokerConfig) { |         if (this.brokerConfig) { | ||||||
|             this.status({fill:"red",shape:"ring",text:"disconnected"},true); |             this.status({fill:"red",shape:"ring",text:"disconnected"},true); | ||||||
| @@ -130,6 +128,7 @@ module.exports = function(RED) { | |||||||
|                     this.client.publish(msg); |                     this.client.publish(msg); | ||||||
|                 } |                 } | ||||||
|             }); |             }); | ||||||
|  |             var node = this; | ||||||
|             this.client.on("connectionlost",function() { |             this.client.on("connectionlost",function() { | ||||||
|                 node.status({fill:"red",shape:"ring",text:"disconnected"}); |                 node.status({fill:"red",shape:"ring",text:"disconnected"}); | ||||||
|             }); |             }); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user