瀏覽代碼

Blinking Node inteval

master
Massimo 4 年之前
父節點
當前提交
c8e93985d4
共有 5 個檔案被更改,包括 13 行新增2 行删除
  1. +1
    -1
      CHANGELOG.md
  2. +1
    -0
      README.md
  3. +1
    -0
      boolean-logic-ultimate/BlinkerUltimate.html
  4. +9
    -0
      boolean-logic-ultimate/BlinkerUltimate.js
  5. +1
    -1
      package.json

+ 1
- 1
CHANGELOG.md 查看文件

@@ -4,7 +4,7 @@
<a href="http://eepurl.com/gJm095" target="_blank">Subscribe to my channel.</a> Only news about my nodes, no spam, no ads. I'm a github developer, not a merchant.

<p>
<b>Version 1.0.13</b><br/>
<b>Version 1.0.14</b><br/>
- NEW: added blinker node. Thanks to @Marco for the suggestion.</br>
</p>
<p>

+ 1
- 0
README.md 查看文件

@@ -111,6 +111,7 @@ The input message is preserved and passed to the output pin, changing only the t
The pourpose of this node is to blink a led or something.<br />
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>

<img src='https://raw.githubusercontent.com/Supergiovane/node-red-contrib-boolean-logic-ultimate/master/img/blinker.png' width='60%'>


+ 1
- 0
boolean-logic-ultimate/BlinkerUltimate.html 查看文件

@@ -44,6 +44,7 @@
<p>The meaning of this node is to blink a light or something else.<br/>
<p>Pass msg.payload = true to start blinking</br>
Pass msg.payload = false to stop blinking</br>
Pass msg.interval = 2000 to change the blinking interval</br>
</p>
<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>


+ 9
- 0
boolean-logic-ultimate/BlinkerUltimate.js 查看文件

@@ -20,8 +20,17 @@ module.exports = function (RED) {
if (node.tBlinker !== null) clearInterval(node.tBlinker);
setNodeStatus({ fill: "red", shape: "dot", text: "|| Off" });
node.send({ payload: false });
node.curPayload = false;
}
}
if (msg.hasOwnProperty("interval")) {
try {
node.blinkfrequency = msg.interval;
} catch (error) {
node.blinkfrequency = 500;
setNodeStatus({ fill: "red", shape: "dot", text: "Invalid interval received" });
}
}

});


+ 1
- 1
package.json 查看文件

@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-boolean-logic-ultimate",
"version": "1.0.13",
"version": "1.0.14",
"description": "A set of Node-RED enhanced boolean logic, with persisten values after reboot and more",
"author": "Supergiovane (https://github.com/Supergiovane)",
"dependencies": {

Loading…
取消
儲存