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.

76 lines (67 loc) 2.96 kB
<script type="text/javascript"> RED.nodes.registerType('toggleUltimate', { category: 'boolean logic ultimate', color: '#ff8080', defaults: { name: { value: "Toggle" }, valueToToggle: { value: "true" }, payloadPropName: { value: "payload", required: false } }, inputs: 1, outputs: 1, icon: "serial.png", label: function () { return this.name || "Toggle"; }, paletteLabel: function () { return "toggleUltimate"; }, oneditprepare: function () { if ($("#node-input-payloadPropName").val() === "") $("#node-input-payloadPropName").val("payload"); $("#node-input-payloadPropName").typedInput({ default: 'msg', types: ['msg'] }); } }); </script> <script type="text/x-red" data-template-name="toggleUltimate"> <div class="form-row"> <b>Toggle 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/VijkMBpt_CM"><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"> <label style="width:160px" for="node-input-valueToToggle"><i class="fa fa-toggle-on"></i> Initial value</label> <select type="text" id="node-input-valueToToggle" placeholder=""> <option value="true">Initialize with True</option> <option value="false">Initialize with False</option> </select> </div> <!-- <div class="form-row"> <input type="checkbox" id="node-input-homeAssitantBoolean" style="display:inline-block; width:auto; vertical-align:top;"> &nbsp; <label style="width:85%" for="node-input-homeAssitantBoolean"> <i class="fa fa-home"></i>&nbsp;Output Home Assistant "on"/"off" instead of true/false </label> </div> --> </script> <script type="text/markdown" data-help-name="toggleUltimate"> [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) The pourpose of this node is to toggle between true/false, everytime an inboud message arrives.<br /> |Property|Description| |--|--| | Input | Set the property where the input payload is. *By default, it is "payload", but you can also specify other properties, for example "payload.value"* | **INPUT**<br /> Any message that arrives on input, will be passwd through to the output with the payload toggled between true and false. </script>