node-red-contrib-power-saver 5.0.0-beta.3 → 5.0.0-beta.4

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.
@@ -7,6 +7,10 @@ sidebarDepth: 1
7
7
 
8
8
  List the most significant changes.
9
9
 
10
+ ## 5.0.0.beta.4
11
+
12
+ - Fix bug on recovery time when recoveryMaxMinutes is not set
13
+
10
14
  ## 5.0.0.beta.3
11
15
 
12
16
  - Implement minute support in Heat Capacitor
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-power-saver",
3
- "version": "5.0.0-beta.3",
3
+ "version": "5.0.0-beta.4",
4
4
  "description": "A module for Node-RED that you can use to turn on and off a switch based on power prices",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -45,7 +45,8 @@ function isOnOffSequencesOk(
45
45
  reachedMinOff = true;
46
46
  }
47
47
  const minRounded = Math.max(Math.round(offCount * recoveryPercentage / 100), 1)
48
- minOnAfterOff = Math.min(minRounded, recoveryMaxMinutes ?? minRounded)
48
+ const recMaxMin = recoveryMaxMinutes === "" ? null : recoveryMaxMinutes;
49
+ minOnAfterOff = Math.min(minRounded, recMaxMin ?? minRounded)
49
50
  if(i === onOff.length - 1) {
50
51
  // If last minute, consider min reached
51
52
  reachedMinOn = true;