node-red-contrib-power-saver 3.5.4 → 3.5.5

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.
@@ -6,6 +6,10 @@ sidebar: "auto"
6
6
 
7
7
  List the most significant changes, starting in version 1.0.9.
8
8
 
9
+ ## 3.5.5
10
+
11
+ - Fix config storage for Best Save node
12
+
9
13
  ## 3.5.4
10
14
 
11
15
  - Fix bug in context selection
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "node-red-contrib-power-saver",
3
- "version": "3.5.4",
3
+ "version": "3.5.5",
4
+
4
5
  "description": "A module for Node-RED that you can use to turn on and off a switch based on power prices",
5
6
  "main": "index.js",
6
7
  "scripts": {
@@ -1,14 +1,12 @@
1
1
  const { countAtEnd, makeSchedule, getSavings, getDiff } = require("./utils");
2
2
  const { handleStrategyInput } = require("./handle-input");
3
3
  const { loadDayData } = require("./utils");
4
-
5
4
  const mostSavedStrategy = require("./strategy-best-save-functions");
6
5
 
7
6
  module.exports = function (RED) {
8
7
  function StrategyBestSaveNode(config) {
9
8
  RED.nodes.createNode(this, config);
10
9
  const node = this;
11
-
12
10
  node.status({});
13
11
 
14
12
  const originalConfig = {
@@ -19,7 +17,7 @@ module.exports = function (RED) {
19
17
  outputIfNoSchedule: config.outputIfNoSchedule === "true",
20
18
  contextStorage: config.contextStorage || "default",
21
19
  };
22
- node.context().set("config", originalConfig, originalConfig.contextStorage);
20
+ node.context().set("config", originalConfig);
23
21
  node.contextStorage = originalConfig.contextStorage;
24
22
 
25
23
  node.on("close", function () {
@@ -20,6 +20,8 @@ module.exports = function (RED) {
20
20
  contextStorage: config.contextStorage || "default",
21
21
  };
22
22
  node.context().set("config", originalConfig);
23
+ node.contextStorage = originalConfig.contextStorage;
24
+
23
25
 
24
26
  node.on("close", function () {
25
27
  clearTimeout(node.schedulingTimeout);