UNPKG

node-red-contrib-broadlink-control

Version:

Node Red nodes to control the Broadlink RM devices and other Broadlink home automation nodes.

19 lines (17 loc) 551 B
module.exports = function (RED) { var Broadlink = require("./Broadlink.js"); function broadlinkNode(config) { RED.nodes.createNode(this, config); var node = this; this.on('input', function (msg) { var b = new Broadlink(); b.setup(config.ssid, node.credentials.password, config.security_mode); node.send(msg); }); } RED.nodes.registerType("Setup", broadlinkNode, { credentials: { password: { type: "password" } } }); }