fix incorrect day counting with dry days option
This commit is contained in:
@@ -69,7 +69,7 @@ static void read_time_and_moisture()
|
||||
s_app.today_is_watering_day = false;
|
||||
uint8_t now_normalized = cur_wd + (cur_wd < s_app.last_watering_day_wd ? 7 : 0);
|
||||
uint8_t elapsed_days = now_normalized - s_app.last_watering_day_wd;
|
||||
if (elapsed_days >= app_config.scheduler_dry_days) {
|
||||
if (elapsed_days > app_config.scheduler_dry_days) {
|
||||
s_app.today_is_watering_day = true;
|
||||
s_app.last_watering_day_wd = cur_wd;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user