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.

84 lines (74 loc) 2.58 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. --> <script type="text/javascript"> RED.nodes.registerType('cm4-pro-digital-input', { category: 'parallax', color: '#C0C0C0', defaults: { name: { value: "" }, }, inputs: 0, outputs: 2, llmNotes: ` - Purpose: - This node represents the digital input events. Inputs: - Does not accept any node-red inputs. Outputs: - The node has two outputs which correspond to digital-input port 1 and 2. - Emits msg.payload.Value where Value is of type Bool, ie: {"Input": <port>, "Value": <bool>}. Usage Rules: - IF user wants digital input 1, connect it to the first output. - IF user wants digital input 2, connect it to the second output. - IF the user wants both ports, use both outputs. - Dont add a second node for a second output, use the available outputs. Wiring Examples: 1. Using BOTH digital inputs (output1 + output2): - Both outputs must wire to the SAME downstream node (e.g., the and-gate). - JSON shape example how to use both digital inputs: { "id": "node1", "type": "cm4-pro-digital-input", "name": "Digital Inputs", "x": 100, "y": 150, "wires": [ ["node2"], ["node2"] ] } `, icon: "font-awesome/fa-arrows-v", label: function() { return this.name || "cm4-pro-digital-input"; }, labelStyle: function() { return this.name ? "node_label_italic" : ""; } }); </script> <script type="text/html" data-template-name="cm4-pro-digital-input"> <!-- Name --> <div class="form-row"> <label for="node-input-name"><i class="icon-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> <div> <small> <p>This node is triggered on a digital input event.</p> <p>Outputs: JSON Object, i.e.: {"Input": 1, "Value": true}</p> </small> </div> </script> <script type="text/html" data-help-name="cm4-pro-digital-input"> <p>This node is triggered on a digital input event. </p> <p>Outputs: JSON Object, i.e.: {"Input": 1, "Value": true} </p> </script>