@aeroniemi/node-red-xled
Version:
Node-Red nodes for controlling the brightness/colour of Twinkly lights
20 lines (19 loc) • 771 B
JavaScript
// -----------------------------------------------------------------------------
// xled-server config node
// The "host" twinkly light, required for all other nodes
// -----------------------------------------------------------------------------
Object.defineProperty(exports, "__esModule", { value: true });
var xled2_1 = require("xled2");
// create node
function default_1(RED) {
function initNodeConstructor(config) {
RED.nodes.createNode(this, config);
if (!config.host)
throw new Error("No Hostname/IP Address included in config");
this.host = config.host;
this.light = new xled2_1.Light(config.host);
}
RED.nodes.registerType("xled-server", initNodeConstructor);
}
exports.default = default_1;
;