node-red-contrib-boolean-logic-ultimate 1.0.55 → 1.0.56
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/CHANGELOG.md +5 -0
- package/README.md +5 -1
- package/boolean-logic-ultimate/utils.js +7 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
# CHANGELOG
|
|
5
5
|
|
|
6
|
+
<p>
|
|
7
|
+
<b>Version 1.0.56</b> August 2022<br/>
|
|
8
|
+
- NEW: added string conversion from "true", "false", "0", "1", "close" to boolean.</br>
|
|
9
|
+
- Updated the README</br>
|
|
10
|
+
</p>
|
|
6
11
|
<p>
|
|
7
12
|
<b>Version 1.0.55</b> July 2022<br/>
|
|
8
13
|
- NEW: you can now specify the input property name from witch the node picks up the payload.</br>
|
package/README.md
CHANGED
|
@@ -30,7 +30,11 @@ Other than true/false, all nodes accepts these strings and convert it to true/fa
|
|
|
30
30
|
| "active" | true |
|
|
31
31
|
| "inactive" | false |
|
|
32
32
|
| "open" | true |
|
|
33
|
-
| "closed" | false |
|
|
33
|
+
| "closed" or "close" | false |
|
|
34
|
+
| "true" | true |
|
|
35
|
+
| "false" | false |
|
|
36
|
+
| "1" | true |
|
|
37
|
+
| "0" | false |
|
|
34
38
|
|
|
35
39
|
|
|
36
40
|
<br/>
|
|
@@ -14,6 +14,13 @@ module.exports.ToBoolean = function ToBoolean(value) {
|
|
|
14
14
|
|
|
15
15
|
if (value.toLowerCase() === "open") return true;
|
|
16
16
|
if (value.toLowerCase() === "closed") return false;
|
|
17
|
+
if (value.toLowerCase() === "close") return false;
|
|
18
|
+
|
|
19
|
+
if (value.toLowerCase() === "1") return true;
|
|
20
|
+
if (value.toLowerCase() === "0") return false;
|
|
21
|
+
|
|
22
|
+
if (value.toLowerCase() === "true") return true;
|
|
23
|
+
if (value.toLowerCase() === "false") return false;
|
|
17
24
|
|
|
18
25
|
} else if (typeof value === 'number') {
|
|
19
26
|
// Is it formated as a decimal number?
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-boolean-logic-ultimate",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.56",
|
|
4
4
|
"description": "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.",
|
|
5
5
|
"author": "Supergiovane (https://github.com/Supergiovane)",
|
|
6
6
|
"dependencies": {
|