From 2b3698012ac820d33b9f07b639e1299da01def31 Mon Sep 17 00:00:00 2001 From: Richard Genoud Date: Tue, 3 Mar 2020 12:29:09 +0100 Subject: [PATCH] thermostat: fix holiday bug (order was not applied) --- soft/thermostat/src/mainwindow.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/soft/thermostat/src/mainwindow.cpp b/soft/thermostat/src/mainwindow.cpp index 07e232b..efd6865 100644 --- a/soft/thermostat/src/mainwindow.cpp +++ b/soft/thermostat/src/mainwindow.cpp @@ -433,25 +433,25 @@ void MainWindow::apply_order_to_heaters(void) if (m_end_holiday > QDate::currentDate()) { qDebug() << "Holiday mode => emit ALL_OFF order"; emit setAllHeatersOn(false); - } - - switch (s->m_state) { - case AUTO: - qDebug() << "apply AUTO state"; - apply_automatic_state(); - break; - case ON: - heating_order = true; - /* fall through */ - case OFF: - /* fall through */ - default: - emit setAllHeatersOn(heating_order); - - for (int i = 0; i < s->m_rooms.count(); i++) { - m_zones.at(i)->refresh(); + } else { + switch (s->m_state) { + case AUTO: + qDebug() << "apply AUTO state"; + apply_automatic_state(); + break; + case ON: + heating_order = true; + /* fall through */ + case OFF: + /* fall through */ + default: + emit setAllHeatersOn(heating_order); + + for (int i = 0; i < s->m_rooms.count(); i++) { + m_zones.at(i)->refresh(); + } + break; } - break; } }