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.

106 lines (96 loc) 3.83 kB
<script type="text/javascript"> RED.nodes.registerType('BlinkerUltimate', { category: 'Boolean Logic Ultimate', color: '#ff8080', defaults: { name: { value: "Blinker" }, stopbehaviorPIN1: { value: "0" }, stopbehaviorPIN2: { value: "0" }, blinkfrequency: { value: "500" }, initializewith: { value: "0" }, payloadPropName: { value: "payload", required: false } }, inputs: 1, outputs: 2, outputLabels: function (i) { switch (i) { case 0: return "Output"; break; case 1: return "Inverted Output"; break; default: break; } }, icon: "light.png", label: function () { return (this.name || "Blinker") + " (" + this.blinkfrequency + "ms)"; }, paletteLabel: function () { return "Blinker"; }, 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="BlinkerUltimate"> <div class="form-row"> <b>Blinker 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/HtMoutMFB6A"><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 for="node-input-blinkfrequency"><i class="fa fa-clock-o"></i> Blink every (in milliseconds)</label> <input type="text" id="node-input-blinkfrequency" placeholder="Example: 500"> </div> <div class="form-row"> <label for="node-input-stopbehaviorPIN1"><i class="fa fa-stop"></i> PIN1 stop behavior</label> <select type="text" id="node-input-stopbehaviorPIN1"> <option value="0">Send false</option> <option value="1">Send true</option> </select> </div> <div class="form-row"> <label for="node-input-stopbehaviorPIN2"><i class="fa fa-stop"></i> PIN2 stop behavior</label> <select type="text" id="node-input-stopbehaviorPIN2"> <option value="0">Send false</option> <option value="1">Send true</option> </select> </div> <div class="form-row"> <label for="node-input-initializewith"><i class="fa fa-home"></i> Autostart</label> <select type="text" id="node-input-initializewith" placeholder=""> <option value="0">Don't start the blinker automatically</option> <option value="1">Start the blinker automatically</option> </select> </div> </script> <script type="text/markdown" data-help-name="BlinkerUltimate"> <p>The pourpose of this node is to blink a led, a light, or anything you like.</p> |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"* | <br/> * Input message Pass <code>msg.payload = true</code> to start blinking</br> Pass <code>msg.payload = false</code> to stop blinking</br> Pass <code>msg.interval = 2000</code> to change the blinking interval</br> <br/> <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>