Start high-to-low animation before sunset

Low-to-high animation runs from sunrise to sunrise+duration. However,
high-to-low animation ran from sunset to sunset+duration.

Run high-to-low animation at sunset-duration to sunset.
master
Kenny Levinsen 2020-09-26 19:27:48 +02:00
parent 07f2f1d3ce
commit 39b211da95
1 changed files with 2 additions and 0 deletions

2
main.c
View File

@ -259,6 +259,8 @@ static void recalc_stops(struct context *ctx, time_t now) {
fprintf(stderr, "calculated new sun trajectory: sunrise %02d:%02d, sunset %02d:%02d\n", fprintf(stderr, "calculated new sun trajectory: sunrise %02d:%02d, sunset %02d:%02d\n",
sunrise.tm_hour, sunrise.tm_min, sunrise.tm_hour, sunrise.tm_min,
sunset.tm_hour, sunset.tm_min); sunset.tm_hour, sunset.tm_min);
ctx->stop_time -= ctx->duration;
} }
static void update_temperature(struct context *ctx, time_t now) { static void update_temperature(struct context *ctx, time_t now) {