Browse Source

thermostat: switch payload to 1/0, it will be easier for external mqtt parsing

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

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

@ -213,7 +213,7 @@ void MainWindow::apply_automatic_state(void)
qDebug() << "heater " << h->ctrl_topic;
/* TODO: check if connected */
m_mqtt->publish_msg(h->ctrl_topic,
m_zones.at(i)->m_heating_on ? "on" : "off");
m_zones.at(i)->m_heating_on ? "1" : "0");
}
}
}


+ 1
- 1
soft/thermostat/src/mqttclient.cpp View File

@ -121,7 +121,7 @@ void MQTTClient::publish_msg(const QString& topic, const QString& payload)
void MQTTClient::allHeatersOn(bool on) {
Settings *s = Settings::getInstance();
QString payload = on ? QString("on") : QString("off");
QString payload = on ? QString("1") : QString("0");
for (int i = 0; i < s->nbZones(); i++) {
const struct Room *r = &(s->m_rooms.at(i));


Loading…
Cancel
Save