2
0

feat(all): add all devices node

This commit is contained in:
Pierre CLEMENT
2018-01-01 03:54:28 +01:00
parent 7742e99f75
commit 3ebdbf9100
4 changed files with 66 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
module.exports = function(RED) {
"use strict";
var mustache = require("mustache");
var miDevicesUtils = require('../utils');
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);
});
}
}
RED.nodes.registerType("xiaomi-all", XiaomiAllNode);
}