2
0

doc(main): update documentation and flows

This commit is contained in:
Pierre CLEMENT
2018-03-21 23:29:36 +01:00
parent c850ca9536
commit d04f5c1196
65 changed files with 2990 additions and 4 deletions

24
dist/nodes/actions/Light.js vendored Normal file
View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("../constants");
exports.default = (RED) => {
class Light {
constructor(props) {
RED.nodes.createNode(this, props);
this.color = props.color;
this.brightness = props.brightness;
this.setListeners();
}
setListeners() {
this.on('input', (msg) => {
msg.payload = {
action: "setLight",
color: msg.color || this.color,
brightness: msg.brightness || this.brightness
};
this.send(msg);
});
}
}
RED.nodes.registerType(`${constants_1.Constants.NODES_PREFIX}-actions light`, Light);
};