node-red-contrib-pylips-philips-tv-control
Version:
This is only a subflow which then calls the python script in pylips. So the rest of the readme is directly copied from there.
16 lines (14 loc) • 513 B
JavaScript
const fs = require("fs");
const path = require("path");
module.exports = function(RED) {
const subflowFile = path.join(__dirname,"subflow.json");
const subflowContents = fs.readFileSync(subflowFile);
const subflowJSON = JSON.parse(subflowContents);
const pylipsDir = path.join(__dirname, "node_modules", "pylips", "pylips.py")
subflowJSON.env.push( {
"name": "path",
"type": "str",
"value": pylipsDir
});
RED.nodes.registerSubflow(subflowJSON);
}