@mschaeffler/node-red-logic 3.6.0 → 3.6.1
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/math_hysteresis.js +1 -1
- package/math_mean.js +2 -2
- package/math_reduce.js +2 -1
- package/math_statistics.js +2 -1
- package/package.json +1 -1
- package/tools.js +5 -0
package/math_hysteresis.js
CHANGED
|
@@ -84,7 +84,7 @@ module.exports = function(RED) {
|
|
|
84
84
|
getPayload( function(value)
|
|
85
85
|
{
|
|
86
86
|
msg.value = Number( value );
|
|
87
|
-
let status = { fill:data[msg.topic]?.status??"gray", shape:"dot", text:msg.value
|
|
87
|
+
let status = { fill:data[msg.topic]?.status??"gray", shape:"dot", text:tools.formatNumber( msg.value ) };
|
|
88
88
|
|
|
89
89
|
if( ! isNaN( msg.value ) )
|
|
90
90
|
{
|
package/math_mean.js
CHANGED
|
@@ -93,7 +93,7 @@ module.exports = function(RED) {
|
|
|
93
93
|
msg.count = count;
|
|
94
94
|
last[msg.topic] = {value:value,time:now};
|
|
95
95
|
context.set( "last", last );
|
|
96
|
-
node.status({fill:"green",shape:"dot",text:`${item.length} / ${
|
|
96
|
+
node.status({fill:"green",shape:"dot",text:`${item.length} / ${tools.formatNumber(value)}`});
|
|
97
97
|
send( msg );
|
|
98
98
|
}
|
|
99
99
|
|
|
@@ -118,7 +118,7 @@ module.exports = function(RED) {
|
|
|
118
118
|
}
|
|
119
119
|
else
|
|
120
120
|
{
|
|
121
|
-
node.status({fill:"gray",shape:"dot",text:`${item.length} / ${
|
|
121
|
+
node.status({fill:"gray",shape:"dot",text:`${item.length} / ${tools.formatNumber(value)}`});
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
else
|
package/math_reduce.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
module.exports = function(RED) {
|
|
2
|
+
var tools = require('./tools.js');
|
|
2
3
|
|
|
3
4
|
function ReduceNode(config) {
|
|
4
5
|
RED.nodes.createNode(this,config);
|
|
@@ -112,7 +113,7 @@ module.exports = function(RED) {
|
|
|
112
113
|
{
|
|
113
114
|
case "mean": msg.payload /= msg.count; break;
|
|
114
115
|
}
|
|
115
|
-
status.text = msg.payload
|
|
116
|
+
status.text = tools.formatNumber( msg.payload );
|
|
116
117
|
if( node.filter )
|
|
117
118
|
{
|
|
118
119
|
if( msg.payload !== node.last )
|
package/math_statistics.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
module.exports = function(RED) {
|
|
2
|
+
var tools = require('./tools.js');
|
|
2
3
|
|
|
3
4
|
function StatsNode(config) {
|
|
4
5
|
RED.nodes.createNode(this,config);
|
|
@@ -103,7 +104,7 @@ module.exports = function(RED) {
|
|
|
103
104
|
msg.stat.variation = msg.stat.deviation / msg.stat.average;
|
|
104
105
|
if( node.showState )
|
|
105
106
|
{
|
|
106
|
-
node.status({fill:"green",shape:"dot",text:`${msg.stat.count} / ${msg.stat.deviation
|
|
107
|
+
node.status({fill:"green",shape:"dot",text:`${msg.stat.count} / ${tools.formatNumber(msg.stat.deviation)}`});
|
|
107
108
|
}
|
|
108
109
|
send( msg );
|
|
109
110
|
}
|
package/package.json
CHANGED