refactor: code clean up
This commit is contained in:
@@ -1,18 +1,12 @@
|
||||
module.exports = function(RED) {
|
||||
"use strict";
|
||||
var mustache = require("mustache");
|
||||
var miDevicesUtils = require('../utils');
|
||||
|
||||
module.exports = (RED) => {
|
||||
function XiaomiAllNode(config) {
|
||||
RED.nodes.createNode(this, config);
|
||||
this.gateway = RED.nodes.getNode(config.gateway);
|
||||
|
||||
var node = this;
|
||||
|
||||
if (this.gateway) {
|
||||
node.on('input', function(msg) {
|
||||
msg.payload = node.gateway.deviceList;
|
||||
node.send(msg);
|
||||
this.on('input', (msg) => {
|
||||
msg.payload = this.gateway.deviceList;
|
||||
this.send(msg);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user