UNPKG

node-red-contrib-boolean-logic-ultimate

Version:

A set of Node-RED enhanced boolean logic and utility nodes, flow interruption, blinker, invert, filter, toggle etc.., with persistent values after reboot. Compatible also with Homeassistant values.

88 lines (79 loc) 3.17 kB
<script type="text/javascript"> RED.nodes.registerType('FilterUltimate', { category: 'Boolean Logic Ultimate', color: '#ff8080', defaults: { name: { value: "Filter" }, payloadPropName: { value: "payload", required: false }, translatorConfig: { type: "translator-config", required: false } }, inputs: 1, outputs: 2, outputLabels: function (i) { var ret = ""; switch (i) { case 0: return "True"; break; case 1: return "False"; break; default: break; } }, icon: "switch.png", label: function () { return this.name || "Filter"; }, paletteLabel: function () { return "Filter"; }, oneditprepare: function () { if ($("#node-input-payloadPropName").val() === "") $("#node-input-payloadPropName").val("payload"); $("#node-input-payloadPropName").typedInput({ default: 'msg', types: ['msg'] }); } }); </script> <script type="text/html" data-template-name="FilterUltimate"> <div class="form-row"> <b>Filter Ultimate</b>&nbsp&nbsp&nbsp&nbsp<span style="color:red"><i class="fa fa-question-circle"></i>&nbsp<a target="_blank" href="https://github.com/Supergiovane/node-red-contrib-boolean-logic-ultimate"><u>Help online</u></a></span> &nbsp&nbsp&nbsp<span style="color:red"><i class="fa fa-youtube-play"></i>&nbsp<a target="_blank" href="https://youtu.be/DXfpXRM-LJA"><u>Youtube Sample</u></a></span> <br/> <br/> </div> <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 class="form-row"> <label for="node-input-payloadPropName"><i class="fa fa-ellipsis-h"></i> Input</label> <input type="text" id="node-input-payloadPropName"> </div> <div class="form-row"> <br /> <b>Translator</b> <br/> <label for="node-input-translatorConfig" > <font color="green" size="4px"><i class="fa fa-sign-in" aria-hidden="true"></i></font> Input </label> <input type="text" id="node-input-translatorConfig" /> </div> </script> <script type="text/markdown" data-help-name="FilterUltimate"> <p>This node filters the input msg by *true* and *false*<p> This node has 2 outputs.<br /> If the input payload is true, the node will send <code>true</code> on output 1 and nothing on output 2 <br/> If the input payload is false, the node will send nothing on output 1 and <code>false</code> on output 2 <br/> The input message is preserved and passed to the output, changing only the topic and the payload. If the input message has it's own topic, it'll be preserved as well. <br/> |Property|Description| |--|--| | Input | It's the msg property to be evaluated. *By default, it is "payload", but you can also specify other properties, for example "payload.value"* | | Translator Input | Translates the incoming <code>payload</code> value, to true/false. This allows the compatibility with, for example, **HomeAssistant** nodes. | <br/> [SEE THE README FOR FULL HELP AND SAMPLES](https://github.com/Supergiovane/node-red-contrib-boolean-logic-ultimate) [Find it useful?](https://www.paypal.me/techtoday) </script>