From 85f1f1f6dd9371e939ed37beb5aca23b1f71e294 Mon Sep 17 00:00:00 2001 From: Richard Genoud Date: Sun, 5 Jan 2020 11:02:34 +0100 Subject: [PATCH] thermostat: bug: fix (again) dayOfWeek matching --- soft/thermostat/src/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/soft/thermostat/src/mainwindow.cpp b/soft/thermostat/src/mainwindow.cpp index 4fd1942..1589f56 100644 --- a/soft/thermostat/src/mainwindow.cpp +++ b/soft/thermostat/src/mainwindow.cpp @@ -132,10 +132,10 @@ double MainWindow::get_target_temperature(int room_idx) /* * dayOfWeek() returns 1 for monday, 7 for sunday. - * so dow <<= 1 gives 0 for monday, 6 for sunday. + * so dow -= 1 gives 0 for monday, 6 for sunday. * And (1 << dow) gives the day of week as a bit field */ - dow <<= 1; + dow -= 1; for (int i = 0; i < r->progs.count(); i++) { p = &(r->progs.at(i)); if ((1 << dow) & p->DoW) {