node-red-contrib-eskomsepush 0.0.3 → 0.0.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.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/nodes/eskomsepush.js +4 -3
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Internally the node checks every minute if a schedule is currently active or not
|
|
|
14
14
|
|
|
15
15
|

|
|
16
16
|
|
|
17
|
-
The node has been made to work well together with the [@victronenergy/node-red-contrib-victron](https://flows.nodered.org/node/@victronenergy/node-red-contrib-victron) nodes. One of the main
|
|
17
|
+
The node has been made to work well together with the [@victronenergy/node-red-contrib-victron](https://flows.nodered.org/node/@victronenergy/node-red-contrib-victron) nodes. One of the main ones being the
|
|
18
18
|
ESS control node for setting the MinSoc, based on the currently active stage. You can find the
|
|
19
19
|
example flow for this via importing the [victron-minsoc-stage-based.json](examples/victron-minsoc-stage-based.json) example.
|
|
20
20
|
|
package/package.json
CHANGED
package/src/nodes/eskomsepush.js
CHANGED
|
@@ -106,7 +106,7 @@ module.exports = function (RED) {
|
|
|
106
106
|
end: Date.parse(Schedule.schedule.days[0].date + ' ' + schedule.split('-')[1])
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
if (
|
|
109
|
+
if (nowtime < schedule.split('-')[0]) {
|
|
110
110
|
LoadShedding.schedule.next = {
|
|
111
111
|
start: Date.parse(Schedule.schedule.days[0].date + ' ' + schedule.split('-')[0]),
|
|
112
112
|
end: Date.parse(Schedule.schedule.days[0].date + ' ' + schedule.split('-')[1])
|
|
@@ -116,8 +116,8 @@ module.exports = function (RED) {
|
|
|
116
116
|
if (Object.keys(LoadShedding.schedule.next).length === 0) {
|
|
117
117
|
const s = Schedule.schedule.days[1].stages[stage - 1][0]
|
|
118
118
|
LoadShedding.schedule.next = {
|
|
119
|
-
start: Date.parse(Schedule.
|
|
120
|
-
end: Date.parse(Schedule.
|
|
119
|
+
start: Date.parse(Schedule.schedule.days[1].date + ' ' + s.split('-')[0]),
|
|
120
|
+
end: Date.parse(Schedule.schedule.days[1].date + ' ' + s.split('-')[1])
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
LoadShedding.event.next = {
|
|
@@ -132,6 +132,7 @@ module.exports = function (RED) {
|
|
|
132
132
|
|
|
133
133
|
if (!LoadShedding.schedule.next.start || !LoadShedding.event.next.start) {
|
|
134
134
|
node.warn('Unable to find next scheduled event and/or schedule')
|
|
135
|
+
node.warn(LoadShedding)
|
|
135
136
|
return
|
|
136
137
|
}
|
|
137
138
|
if (LoadShedding.schedule.next.start <= LoadShedding.event.next.start) {
|