node-red-contrib-power-saver 3.3.1 → 3.3.2

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.3.2
10
+
11
+ - Add command sendOutput.
12
+
9
13
  ## 3.3.1
10
14
 
11
15
  - Move doc to [power-saver.smoky.no](power-saver.smoky.no)
@@ -70,6 +70,20 @@ You can get the schedule sent to output 3 any time by sending a message like thi
70
70
 
71
71
  When you do this, the current schedule is actually recalculated based on the last received data, and then sent to output 3 the same way as when it was originally planned.
72
72
 
73
+ #### sendOutput
74
+
75
+ You can get the node to send the current output to output 1 or 2 any time by sending a message like this to the node:
76
+
77
+ ```json
78
+ "payload": {
79
+ "commands": {
80
+ "sendOutput": true,
81
+ }
82
+ }
83
+ ```
84
+
85
+ When you do this, the current schedule is actually recalculated based on the last received data. The current output is sent to output 1 or 2, and the schedule is sent to output 3.
86
+
73
87
  #### reset
74
88
 
75
89
  You can reset data the node has saved in context by sending this message:
@@ -94,6 +94,20 @@ You can get the schedule sent to output 3 any time by sending a message like thi
94
94
 
95
95
  When you do this, the current schedule is actually recalculated based on the last received data, and then sent to output 3 the same way as when it was originally planned.
96
96
 
97
+ #### sendOutput
98
+
99
+ You can get the node to send the current output to output 1 or 2 any time by sending a message like this to the node:
100
+
101
+ ```json
102
+ "payload": {
103
+ "commands": {
104
+ "sendOutput": true,
105
+ }
106
+ }
107
+ ```
108
+
109
+ When you do this, the current schedule is actually recalculated based on the last received data. The current output is sent to output 1 or 2, and the schedule is sent to output 3.
110
+
97
111
  #### reset
98
112
 
99
113
  You can reset data the node has saved in context by sending this message:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-power-saver",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
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": {
@@ -63,7 +63,7 @@ function handleStrategyInput(node, msg, doPlanning) {
63
63
 
64
64
  const sendNow = !!node.sendCurrentValueWhenRescheduling && pastSchedule.length > 0 && !sentOnCommand;
65
65
  const currentValue = pastSchedule[pastSchedule.length - 1]?.value;
66
- if (sendNow) {
66
+ if (sendNow || !!msg.payload.commands?.sendOutput) {
67
67
  output1 = currentValue ? { payload: true } : null;
68
68
  output2 = currentValue ? null : { payload: false };
69
69
  }