node-red-contrib-energymeterplus 0.2.5 → 0.2.6
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/energyMeterPlus.js +8 -9
- package/package.json +1 -1
package/energyMeterPlus.js
CHANGED
|
@@ -27,15 +27,14 @@ module.exports = function(RED) {
|
|
|
27
27
|
yearly: Number(config.baselineYearly) || 0
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
30
|
+
// Apply each baseline only to its own counter
|
|
31
|
+
if (storedBaselines.daily) baseline.daily += storedBaselines.daily;
|
|
32
|
+
if (storedBaselines.weekly) baseline.weekly += storedBaselines.weekly;
|
|
33
|
+
if (storedBaselines.monthly) baseline.monthly += storedBaselines.monthly;
|
|
34
|
+
if (storedBaselines.yearly) baseline.yearly += storedBaselines.yearly;
|
|
35
|
+
|
|
36
|
+
node.context().set("baseline", baseline);
|
|
37
|
+
node.context().set("storedBaselines", storedBaselines);
|
|
39
38
|
|
|
40
39
|
// Last timestamp
|
|
41
40
|
let lastCheck = node.context().get("lastCheck") || new Date();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-energymeterplus",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "A custom Node-RED node that integrates power readings into energy totals with persistence and cost calculation.",
|
|
5
5
|
"author": "Arcfrankye",
|
|
6
6
|
"license": "MIT",
|