smart-nodes 0.4.17 → 0.4.18
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 +4 -0
- package/central/central.js +11 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/central/central.js
CHANGED
|
@@ -107,10 +107,19 @@ module.exports = function (RED)
|
|
|
107
107
|
}
|
|
108
108
|
else if (real_topic == "up_down")
|
|
109
109
|
{
|
|
110
|
-
if (new_msg.payload)
|
|
110
|
+
if (new_msg.payload === false)
|
|
111
|
+
{
|
|
111
112
|
new_msg.topic = "down";
|
|
112
|
-
|
|
113
|
+
}
|
|
114
|
+
else if (new_msg.payload === true)
|
|
115
|
+
{
|
|
113
116
|
new_msg.topic = "up";
|
|
117
|
+
}
|
|
118
|
+
else
|
|
119
|
+
{
|
|
120
|
+
helper.warn("Invalid payload for central, topic=up_down. Only boolean is allowed and required");
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
114
123
|
}
|
|
115
124
|
break;
|
|
116
125
|
|