node-red-contrib-eskomsepush 0.0.15 → 0.0.17
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 +6 -6
package/package.json
CHANGED
package/src/nodes/eskomsepush.js
CHANGED
|
@@ -140,16 +140,16 @@ module.exports = function (RED) {
|
|
|
140
140
|
node.warn('API allowance count: ' + EskomSePushInfo.api.info.allowance.count)
|
|
141
141
|
node.warn('Calculated sleeptime: ' + EskomSePushInfo.calc.sleeptime)
|
|
142
142
|
}
|
|
143
|
-
if (EskomSePushInfo.calc.sleeptime <
|
|
144
|
-
EskomSePushInfo.calc.sleeptime =
|
|
143
|
+
if (EskomSePushInfo.calc.sleeptime < 10) {
|
|
144
|
+
EskomSePushInfo.calc.sleeptime = 10
|
|
145
145
|
if (node.config.verbose === true) {
|
|
146
|
-
node.warn('Calculated sleeptime was less than
|
|
146
|
+
node.warn('Calculated sleeptime was less than 10. Set it to 10: ' + EskomSePushInfo.calc.sleeptime)
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
} else {
|
|
150
|
-
EskomSePushInfo.calc.sleeptime =
|
|
150
|
+
EskomSePushInfo.calc.sleeptime = 60
|
|
151
151
|
if (node.config.verbose === true) {
|
|
152
|
-
node.warn('Set sleeptime to
|
|
152
|
+
node.warn('Set sleeptime to 60 since allowance count is low: ' + EskomSePushInfo.calc.sleeptime)
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
|
|
@@ -290,7 +290,7 @@ module.exports = function (RED) {
|
|
|
290
290
|
statusText += ' - ' + new Date(EskomSePushInfo.calc.end).toLocaleTimeString([], { timeStyle: 'short' })
|
|
291
291
|
}
|
|
292
292
|
} else {
|
|
293
|
-
if (new Date(EskomSePushInfo.calc.next.start).getUTCDay() !== now.getUTCDate) {
|
|
293
|
+
if (new Date(EskomSePushInfo.calc.next.start).getUTCDay() !== now.getUTCDate()) {
|
|
294
294
|
statusText += new Date(EskomSePushInfo.calc.next.start).toLocaleString([], { weekday: 'short' }) + ' '
|
|
295
295
|
}
|
|
296
296
|
statusText += new Date(EskomSePushInfo.calc.next.start).toLocaleTimeString([], { timeStyle: 'short' })
|