node-red-contrib-mi-sensors
Version:
A set of nodes to control some of the popular Xiaomi sensors which are connected to the Xiaomi Gateway, and the Gateway itself.
27 lines (26 loc) • 867 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("../constants");
const Searcher_1 = require("./Searcher");
exports.default = (RED) => {
class YeelightConfigurator {
constructor(props) {
RED.nodes.createNode(this, props);
let { ip, sid } = props;
this.sid = sid;
this.ip = ip;
}
set bulb(bulb) {
this._bulb = bulb;
this.emit('bulbFound');
}
get bulb() {
return this._bulb;
}
}
RED.nodes.registerType(`${constants_1.Constants.NODES_PREFIX}-yeelight configurator`, YeelightConfigurator, {
settings: {
miDevicesYeelightConfiguratorDiscoveredBulbs: { value: Searcher_1.Searcher.bulbs, exportable: true }
}
});
};