Browse Source

thermostat: bug: fix dayOfWeek matching

master
Richard Genoud 4 years ago
parent
commit
e3cd83241d
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      soft/thermostat/src/mainwindow.cpp

+ 6
- 1
soft/thermostat/src/mainwindow.cpp View File

@ -130,10 +130,15 @@ double MainWindow::get_target_temperature(int room_idx)
goto out;
}
/*
* dayOfWeek() returns 1 for monday, 7 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;
for (int i = 0; i < r->progs.count(); i++) {
p = &(r->progs.at(i));
if (dow & p->DoW) {
if ((1 << dow) & p->DoW) {
if (p->start_time == p->end_time) {
continue;
}


Loading…
Cancel
Save