UNPKG

node-red-contrib-freya-nodes

Version:

Custom nodes for Freya Vivarium Control System

24 lines (23 loc) 1.24 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; const lightingController = (RED) => { function LightingControllerNode(config) { RED.nodes.createNode(this, config); const node = this; node.status({ fill: 'green', shape: 'dot', text: 'running' }); node.on('input', (msg, send, done) => __awaiter(this, void 0, void 0, function* () { send(msg); done === null || done === void 0 ? void 0 : done(); })); } RED.nodes.registerType('lighting controller', LightingControllerNode); }; module.exports = lightingController;