node-red-contrib-eskomsepush 0.0.13 → 0.0.14

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.13",
3
+ "version": "0.0.14",
4
4
  "description": "Node-RED interface for the Eskomsepush API",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -163,10 +163,10 @@ module.exports = function (RED) {
163
163
 
164
164
  // Are there any events going on?
165
165
  if (Object.entries(EskomSePushInfo.area.info.events).length > 0) {
166
- EskomSePushInfo.calc.type = 'event'
167
166
  const EventStart = Date.parse(EskomSePushInfo.area.info.events[0].start)
168
167
  const EventEnd = Date.parse(EskomSePushInfo.area.info.events[0].end)
169
168
  if (now >= EventStart && now < EventEnd) {
169
+ EskomSePushInfo.calc.type = 'event'
170
170
  EskomSePushInfo.calc.active = true
171
171
  if (EskomSePushInfo.area.info.events[0].note.match(/Stage (\d+)/i)) {
172
172
  EskomSePushInfo.calc.stage = EskomSePushInfo.area.info.events[0].note.match(/Stage (\d+)/i)[1]
@@ -205,7 +205,8 @@ module.exports = function (RED) {
205
205
  EskomSePushInfo.calc.next = {
206
206
  type: 'schedule',
207
207
  start: ScheduleStart,
208
- end: ScheduleEnd
208
+ end: ScheduleEnd,
209
+ stage: EskomSePushInfo.calc.stage
209
210
  }
210
211
  }
211
212
  }
@@ -218,6 +219,7 @@ module.exports = function (RED) {
218
219
  EskomSePushInfo.calc.next.duration = (EskomSePushInfo.calc.next.end - EskomSePushInfo.calc.next.start) / 1000
219
220
  EskomSePushInfo.calc.next.islong = EskomSePushInfo.calc.next.duration >= (4 * 3600)
220
221
  EskomSePushInfo.calc.secondstostatechange = parseInt((EskomSePushInfo.calc.next.start - now) / 1000)
222
+ EskomSePushInfo.calc.next.isHigherStage = EskomSePushInfo.calc.next.stage > EskomSePushInfo.calc.next.stage
221
223
  }
222
224
 
223
225
  if (EskomSePushInfo.calc.active) {