node-red-contrib-looptimer-advanced 0.0.10 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,3 @@
1
-
2
-
3
-
4
1
  Advanced Looptimer for node-red
5
2
 
6
3
 
@@ -11,45 +8,39 @@ Advanced Looptimer for node-red
11
8
 
12
9
  This project is based on **node-red-contrib-looptimer** and **node-red-contrib-looptimer2** with the need of overwrite properties via messages.
13
10
 
14
- **Installation:**
15
- > npm install node-red-contrib-looptimer-advanced
11
+
16
12
 
17
- The main functionality is not changed (for now), however fix from looptimer2 has been implemented, because it did not work with other timers for example **node-red-contrib-stoptimer** and I've did some code rework for better functionality and cleaner code.
13
+ **Installation:**
18
14
 
19
-
15
+ > npm install node-red-contrib-looptimer-advanced
20
16
 
21
17
 
22
18
 
23
- Sends the `msg` through the first output, then continues to do so in a loop, once per the timer duration specified, until a payload of `stop` or `STOP` is received, at which time the second output will automatically send a payload of `stopped`.
19
+ The main functionality is not changed (for now), however fix from looptimer2 has been implemented, because it did not work with other timers for example **node-red-contrib-stoptimer** and I've did some code rework for better functionality and cleaner code.
24
20
 
25
21
 
26
22
 
23
+ Sends the `msg` through the first output, then continues to do so in a loop, once per the timer duration specified, until a payload of `stop` or `STOP` is received, at which time the second output will automatically send a payload of `stopped`.
27
24
 
28
-
29
25
  You can also stop the loop by specifying a maximum number of loops, which when reached, will stop the loop and timer, as well as sending a payload of `max loops reached` through the second output. Keep in mind, the first `msg` simply passes through, and is therefore not part of the loop. So if you set the max loops to `5`, you will get `6 messages`, which is 1 original message, and 5 messages from the loop.
30
-
31
26
 
32
-
33
-
34
-
35
27
  Finally, to ensure you do not end up with an infinite loop, you can set a maximum timeout in seconds, minutes or hours, and when that time is reached, the loop and timer will also be stopped.
36
-
37
28
 
38
-
39
-
40
-
41
29
  The properties can be overridden via `msg.loop` messages supplemented with property name. Accepted messages for loop are `msg.loop.duration` and `msg.loop.units`, for timeout are `msg.loop.maxtimeout` and `msg.loop.maxtimeoutunits`.
42
30
 
43
31
 
44
32
 
45
- You can define maximum number of loops with `msg.loop.maxloops`
46
33
 
47
-
34
+ You can define maximum number of loops with `msg.loop.maxloops`
48
35
 
49
36
 
50
37
 
51
38
  Setting the Max Loops and Max Timeout settings to high values can, for all intents, ensure that the loop can only be stopped by an incoming `stop` payload, however, the stability of the loop has not been tested over an extended number of hours.
39
+
52
40
 
41
+ **0.0.12** - Update README.md
42
+ **0.0.11** - Add Type Check for Stop condition to avoid type error on non string payload converting to LowerCase
43
+ **0.0.10** - Update README.md
53
44
  **0.0.9** - Bugfix for Minutes, and minor improvements to code quality
54
45
  **0.0.8** - Fix Until Node-Red Does Not Get Fixed on issue #3867
55
46
  **0.0.7** - Update Loop Dependency version as older version is not compatible with higher version Node.JS
@@ -57,13 +48,9 @@ Setting the Max Loops and Max Timeout settings to high values can, for all inten
57
48
  **0.0.5** - Re-added line removed accidentally
58
49
  **0.0.4** - Issue #4 -> Added message when timeout reached
59
50
  **0.0.1** - Initial Release
60
-
61
-
62
51
 
52
+ **To Do:**
63
53
 
64
-
54
+ - [ ] Mustache Template Support
65
55
 
66
- **To Do:**
67
-
68
- - [ ] Mustache Template Support
69
56
  - [x] Example Flows
@@ -114,7 +114,7 @@ module.exports = function (RED) {
114
114
  stopped = false;
115
115
  clearTimeout(timeout);
116
116
  timeout = null;
117
- if (msg.payload.toLowerCase() === "stop") {
117
+ if (typeof msg.payload === "string" && msg.payload.toLowerCase() === "stop") {
118
118
  node.status({
119
119
  fill: "red",
120
120
  shape: "ring",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-looptimer-advanced",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "Sends the msg through the first output, then continues to do so in a loop, once per the duration specified, until a payload of 'stop' or 'STOP' is received. Supports override with messages!",
5
5
  "main": "looptimer_advanced.js",
6
6
  "scripts": {},