UNPKG

@parallaxcontrol/node-red-control

Version:

A comprehensive package of Node-RED nodes designed to seamlessly integrate with the Parallax Control Engine, offering enhanced control capabilities for AV Automation.

64 lines (58 loc) 2.15 kB
/* * Copyright (c) 2025 Parallax AV Design Inc. * All rights reserved. * * This software is licensed, not sold. You may not copy, modify, merge, * publish, distribute, sublicense, or sell copies of this file or substantial * portions of it except as expressly permitted by the LICENSE file included * with this package. Use is restricted to building manifests for the * Parallax Control Node-RED nodes. See LICENSE for details. */ module.exports = function(RED) { function ExtractMessageDataNode(config) { RED.nodes.createNode(this, config); var node = this; this.objectSelected = config.objectToGet; node.on('input', function(msg) { //extract-message-data v2 switch(node.objectSelected) { case "Type": { node.status({fill:"blue",shape:"dot",text:"Extracting Type"}); var returnVal = msg.payload.Type; var message = { Type : returnVal } node.send({payload: message }); break; } case "JoinID": { node.status({ fill: "blue", shape: "dot", text: "Extracting JoinID" }); var returnVal = msg.payload.JoinID; var message = { JoinID : returnVal } node.send({payload: message }); break; } case "Value": { node.status({ fill: "blue", shape: "dot", text: "Extracting Value" }); var returnVal = msg.payload.Value; var message = { Value : returnVal } node.send({payload: message }); break; } default: { return null; } } }); } RED.nodes.registerType("extract-message-data", ExtractMessageDataNode); };