Account when forcing high/low state
parent
71f0f904e2
commit
940cf08226
4
main.c
4
main.c
|
@ -238,7 +238,7 @@ static void update_temperature(struct context *ctx) {
|
|||
|
||||
switch (ctx->state) {
|
||||
case HIGH_TEMP:
|
||||
if (now < ctx->stop_time && now > ctx->start_time) {
|
||||
if (now <= ctx->stop_time && now > ctx->start_time + ctx->duration) {
|
||||
temp = ctx->high_temp;
|
||||
break;
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ static void update_temperature(struct context *ctx) {
|
|||
temp = ctx->high_temp - temp_pos;
|
||||
break;
|
||||
case LOW_TEMP:
|
||||
if (now > ctx->stop_time || now < ctx->start_time) {
|
||||
if (now > ctx->stop_time + ctx->duration || now <= ctx->start_time) {
|
||||
temp = ctx->low_temp;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue