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.
package/docs/changelog/README.md
CHANGED
|
@@ -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
package/src/handle-input.js
CHANGED
|
@@ -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
|
}
|