From 960161db3f1cc5c125d23bdb02bde0a8cecbdb4b Mon Sep 17 00:00:00 2001 From: Richard Genoud Date: Fri, 3 Jan 2020 11:30:56 +0100 Subject: [PATCH] thermostat: switch payload to 1/0, it will be easier for external mqtt parsing --- soft/thermostat/src/mainwindow.cpp | 2 +- soft/thermostat/src/mqttclient.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/soft/thermostat/src/mainwindow.cpp b/soft/thermostat/src/mainwindow.cpp index 7edcc9d..30ca7d7 100644 --- a/soft/thermostat/src/mainwindow.cpp +++ b/soft/thermostat/src/mainwindow.cpp @@ -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"); } } } diff --git a/soft/thermostat/src/mqttclient.cpp b/soft/thermostat/src/mqttclient.cpp index 0e11615..bd2c620 100644 --- a/soft/thermostat/src/mqttclient.cpp +++ b/soft/thermostat/src/mqttclient.cpp @@ -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));