Check for zero-value in recalc_stops
parent
a74f7fd44f
commit
0128fb535f
4
main.c
4
main.c
|
@ -243,7 +243,9 @@ static void set_temperature(struct context *ctx) {
|
||||||
static void recalc_stops(struct context *ctx, time_t now) {
|
static void recalc_stops(struct context *ctx, time_t now) {
|
||||||
time_t day = now - (now % 86400);
|
time_t day = now - (now % 86400);
|
||||||
time_t true_end = ctx->stop_time + ctx->duration;
|
time_t true_end = ctx->stop_time + ctx->duration;
|
||||||
if (now > true_end) {
|
if (ctx->stop_time == 0) {
|
||||||
|
// First calculation
|
||||||
|
} else if (now > true_end) {
|
||||||
day += 86400;
|
day += 86400;
|
||||||
} else if (day < true_end) {
|
} else if (day < true_end) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue