node-red-contrib-mysensors
Version:
Mysensors related nodes, for decoding / encoding mysensors serial protocol and MQTT topic, and wrapping arbitrary messages into mysensors compatible messages
12 lines (11 loc) • 529 B
JavaScript
;
const nodered_storage_1 = require("../lib/nodered-storage");
module.exports = (RED) => {
RED.nodes.registerType('mysensorsdb', function MysensorsDb(props) {
RED.nodes.createNode(this, props);
this.contextType = props.contextType || 'flow';
this.contextKey = RED.util.parseContextStore(props.store);
const myContext = this.context()[this.contextType];
this.database = new nodered_storage_1.NoderedStorage(myContext, this.contextKey.key, this.contextKey.store);
});
};