You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

InterruptFlowUltimate.html 3.1KB

5 jaren geleden
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <script type="text/javascript">
  2. RED.nodes.registerType('InterruptFlowUltimate',{
  3. category: 'boolean logic ultimate',
  4. color: '#ff8080',
  5. defaults: {
  6. name: {
  7. value: "Interrupt Flow"
  8. },
  9. triggertopic: {
  10. value: "trigger"
  11. }
  12. },
  13. inputs:1,
  14. outputs:1,
  15. outputLabels: function(i) {
  16. var ret="";
  17. switch (i) {
  18. case 0:
  19. return "True";
  20. break;
  21. case 1:
  22. return "False";
  23. break;
  24. default:
  25. break;
  26. }
  27. },
  28. icon: "file-in.png",
  29. label:
  30. function() {
  31. return (this.name||"Interrupt") + " (" + this.triggertopic + ")";
  32. },
  33. paletteLabel: function() {
  34. return "InterruptFlowUltimate";
  35. }
  36. });
  37. </script>
  38. <script type="text/x-red" data-template-name="InterruptFlowUltimate">
  39. <div class="form-row">
  40. <label for="node-input-name"><i class="icon-tag"></i> Name</label>
  41. <input type="text" id="node-input-name" placeholder="Name">
  42. </div>
  43. <div class="form-row">
  44. <label for="node-input-triggertopic"><i class="icon-tag"></i> Trigger by topic</label>
  45. <input type="text" id="node-input-triggertopic" placeholder="Name">
  46. <div><i>Whenever the node receives a payload = false from this topic,<br/> it stops output messages to the flow.<br/>As soon it receives payload = true from this topic,<br/>the output messages start to flow out again.
  47. <br/>The node will output the current stored message<br/>plus an added property "isReplay = true",<br/>as soon as it receives a "play" = true from this topic.
  48. </i></div>
  49. </div>
  50. </script>
  51. <script type="text/x-red" data-help-name="InterruptFlowUltimate">
  52. <p>
  53. <a href="https://www.paypal.me/techtoday" target="_blank"><img src='https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square' width='30%'></a>
  54. and
  55. <a href="http://eepurl.com/gJm095" target="_blank">Subscribe to my channel</a> for news about my nodes.
  56. </p>
  57. <p>The meaning of this node is to interrupt/reactivate flow messages.<br/>
  58. Normally, passes the input messages to the output. If you send a payload with a specific topic (you can set it on the node properties), the node stops sending output messages.<br/>
  59. It can also save the last message received and play later. This is useful if you wish to restore previous state to, for example, a light actuator.<br/>
  60. Please see the <a href="https://github.com/Supergiovane/node-red-contrib-boolean-logic-ultimate" target="_blank">README</a> on github for examples.
  61. </p>
  62. <p>
  63. The node will stop output messages, if it receives a payload = false <b>from the specified topic</b>.<br/>
  64. The node will resume output messages, if it receives a payload = true <b>from the specified topic</b>.<br/>
  65. Other that that, as soon as you send payload = false <b>from the specified topic</b>, the node stores the last received payload internally
  66. The node will output the current stored message plus an added property <b>isReplay</b> = true, if it receives a <b>play</b> = true from the specified topic.<br/>
  67. </p>
  68. <a href="https://www.paypal.me/techtoday" target="_blank"><img src='https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square' width='30%'></a>
  69. </script>