-
Notifications
You must be signed in to change notification settings - Fork 48
Appling schedule is incorrect #73
Comments
In deed this is part of your problem. |
Ok, this issue seems to be a bit more complicated.
Regarding my first post: the shown "fix" does not work and only changes the log-output. For me the whole update procedure should be fixed in depth. The current way is inconsistent (posting an update for every day, but not requesting the current data from the cloud after the first update) I hope anyone is able to improve the script. I really like it but in the current state it is not reliable. |
I have to correct myself: |
I was wondering often, why the schedule in the Landroid APP and the schedule in landroid bridge do not match. Now I had some time to verify in depth.
With a fresh clone the following happens on appling the schedule:
For every day the schedule shall be applied, the whole schedule is sent to the cloud. I my opinion this happens becaus of (LandroidS.ts :: 66-67):
message[weekday] = this.timePeriodToCloudArray(timePeriod);
this.log.info("Setting new schedule with update for weekday %d to %s", weekday, JSON.stringify(message));
So for everyday the whole schedule is applied. One can see that very nice then the server is run directly in a command line window: for everyday the whole message content is sent.
Changing the last line to JSON.stringify(message[weekday]) works out.
Second: The last applied day is day 7 as by Scheduler.ts :: 38:
if (i <= 7) {
That repeats that loop for 8 times: 0, 1, .... 6, 7. But the 7th day (countet from zero) equals the first. So always the current day is overwritten.
When applying that changes for me it works out.
The text was updated successfully, but these errors were encountered: