node-red-contrib-eskomsepush 0.0.16 → 0.0.18
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 +1 -1
- package/src/nodes/eskomsepush.js +8 -5
package/package.json
CHANGED
package/src/nodes/eskomsepush.js
CHANGED
|
@@ -238,7 +238,8 @@ module.exports = function (RED) {
|
|
|
238
238
|
console.warn('Not an array:', dates.stages[stageIndex]) // Warning if not an array
|
|
239
239
|
}
|
|
240
240
|
} else {
|
|
241
|
-
console.warn(
|
|
241
|
+
console.warn(`Invalid stage index: ${stageIndex}. No loadshedding going on?`) // Warning if stage index is out of bounds
|
|
242
|
+
BreakLoop = true
|
|
242
243
|
}
|
|
243
244
|
if (BreakLoop) { break }
|
|
244
245
|
}
|
|
@@ -290,11 +291,13 @@ module.exports = function (RED) {
|
|
|
290
291
|
statusText += ' - ' + new Date(EskomSePushInfo.calc.end).toLocaleTimeString([], { timeStyle: 'short' })
|
|
291
292
|
}
|
|
292
293
|
} else {
|
|
293
|
-
if (
|
|
294
|
-
|
|
294
|
+
if (EskomSePushInfo.calc.next) {
|
|
295
|
+
if (new Date(EskomSePushInfo.calc.next.start).getUTCDay() !== now.getUTCDate()) {
|
|
296
|
+
statusText += new Date(EskomSePushInfo.calc.next.start).toLocaleString([], { weekday: 'short' }) + ' '
|
|
297
|
+
}
|
|
298
|
+
statusText += new Date(EskomSePushInfo.calc.next.start).toLocaleTimeString([], { timeStyle: 'short' })
|
|
299
|
+
statusText += ' - ' + new Date(EskomSePushInfo.calc.next.end).toLocaleTimeString([], { timeStyle: 'short' })
|
|
295
300
|
}
|
|
296
|
-
statusText += new Date(EskomSePushInfo.calc.next.start).toLocaleTimeString([], { timeStyle: 'short' })
|
|
297
|
-
statusText += ' - ' + new Date(EskomSePushInfo.calc.next.end).toLocaleTimeString([], { timeStyle: 'short' })
|
|
298
301
|
}
|
|
299
302
|
|
|
300
303
|
statusText += ' (API: ' + EskomSePushInfo.api.info.allowance.count + '/' + EskomSePushInfo.api.info.allowance.limit + ')'
|