node-red-contrib-eskomsepush 0.0.4 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-eskomsepush",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Node-RED interface for the Eskomsepush API",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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.schedule.days[1].date + s.split('-')[0]),
120
- end: Date.parse(Schedule.schedule.days[1].date + s.split('-')[1])
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) {