@@ -113,15 +113,20 @@ class Schedule {
113
113
bool isActive () {
114
114
115
115
unsigned int now = _schedule_time_service->getLocalTime ();
116
- if (checkSchedulePeriod (now, frm, to)) {
117
- /* We are in the schedule range */
118
116
119
- if (checkScheduleMask (now, msk)) {
117
+ if (checkTimeValid (now)) {
118
+ /* We have to wait RTC configuration and Timezone setting from the cloud */
119
+
120
+ if (checkSchedulePeriod (now, frm, to)) {
121
+ /* We are in the schedule range */
122
+
123
+ if (checkScheduleMask (now, msk)) {
120
124
121
- /* We can assume now that the schedule is always repeating with fixed delta */
122
- unsigned int delta = getScheduleDelta (msk);
123
- if ( ( (std::max (now , frm) - std::min (now , frm)) % delta ) <= len ) {
124
- return true ;
125
+ /* We can assume now that the schedule is always repeating with fixed delta */
126
+ unsigned int delta = getScheduleDelta (msk);
127
+ if ( ( (std::max (now , frm) - std::min (now , frm)) % delta ) <= len ) {
128
+ return true ;
129
+ }
125
130
}
126
131
}
127
132
}
@@ -292,6 +297,10 @@ class Schedule {
292
297
return ptm->tm_mon ;
293
298
}
294
299
300
+ bool checkTimeValid (unsigned int now) {
301
+ return (now != 0 );
302
+ }
303
+
295
304
bool checkSchedulePeriod (unsigned int now, unsigned int frm, unsigned int to) {
296
305
/* Check if current time is inside the schedule period. If 'to' is equal to
297
306
* 0 the schedule has no end.
0 commit comments