Browse Source

thermostat: bug: fix (again) dayOfWeek matching

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

+ 2
- 2
soft/thermostat/src/mainwindow.cpp View File

@ -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) {


Loading…
Cancel
Save