|
|
@ -206,14 +206,14 @@ void MainWindow::apply_automatic_state(void) |
|
|
|
qDebug() << "apply auto state"; |
|
|
|
for (i = 0; i < s->m_rooms.count(); i++) { |
|
|
|
const struct Room *r = &(s->m_rooms.at(i)); |
|
|
|
bool should_heat = get_heater_order(i); |
|
|
|
m_zones.at(i)->m_heating_on = get_heater_order(i); |
|
|
|
qDebug() << "room " << r->name; |
|
|
|
for (int j = 0; j < r->heaters.count(); j++) { |
|
|
|
const struct Heater *h = &(r->heaters.at(j)); |
|
|
|
qDebug() << "heater " << h->ctrl_topic; |
|
|
|
/* TODO: check if connected */ |
|
|
|
m_mqtt->publish_msg(h->ctrl_topic, |
|
|
|
should_heat ? "on" : "off"); |
|
|
|
m_zones.at(i)->m_heating_on ? "on" : "off"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|