node-red-contrib-eskomsepush 0.0.6 → 0.0.7

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 CHANGED
@@ -16,7 +16,7 @@ Internally the node checks every minute if a schedule is currently active or not
16
16
 
17
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
- example flow for this via importing the [victron-minsoc-stage-based.json](examples/victron-minsoc-stage-based.json) example.
19
+ example flow for this via importing the [victron-minsoc-stage-based.json](examples/victron-minsoc-stage-based.json) file.
20
20
 
21
21
  ### Configuration
22
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-eskomsepush",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Node-RED interface for the Eskomsepush API",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -105,6 +105,10 @@ module.exports = function (RED) {
105
105
  start: Date.parse(Schedule.schedule.days[0].date + ' ' + schedule.split('-')[0]),
106
106
  end: Date.parse(Schedule.schedule.days[0].date + ' ' + schedule.split('-')[1])
107
107
  }
108
+ LoadShedding.schedule.next = {
109
+ start : LoadShedding.schedule.start,
110
+ end : LoadShedding.schedule.end
111
+ }
108
112
  }
109
113
  if (nowtime < schedule.split('-')[0]) {
110
114
  LoadShedding.schedule.next = {
@@ -113,7 +117,7 @@ module.exports = function (RED) {
113
117
  }
114
118
  }
115
119
  }
116
- if (Object.keys(LoadShedding.schedule.next).length === 0) {
120
+ if (!LoadShedding.schedule.active && Object.keys(LoadShedding.schedule.next).length === 0) {
117
121
  const s = Schedule.schedule.days[1].stages[stage - 1][0]
118
122
  LoadShedding.schedule.next = {
119
123
  start: Date.parse(Schedule.schedule.days[1].date + ' ' + s.split('-')[0]),