mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-29 18:19:09 +03:00
use flash strings for MQTT topics
This commit is contained in:
@@ -324,7 +324,7 @@ void Boiler::publish_values() {
|
||||
|
||||
// if we have data, publish it
|
||||
if (!doc.isNull()) {
|
||||
Mqtt::publish("boiler_data", doc);
|
||||
Mqtt::publish(F("boiler_data"), doc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -476,8 +476,8 @@ void Boiler::check_active() {
|
||||
uint8_t latest_boilerState = (tap_water_active_ << 1) + heating_active_;
|
||||
if (latest_boilerState != last_boilerState) {
|
||||
last_boilerState = latest_boilerState;
|
||||
Mqtt::publish("tapwater_active", tap_water_active_);
|
||||
Mqtt::publish("heating_active", heating_active_);
|
||||
Mqtt::publish(F("tapwater_active"), tap_water_active_);
|
||||
Mqtt::publish(F("heating_active"), heating_active_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ void Solar::publish_values() {
|
||||
|
||||
// if we have data, publish it
|
||||
if (!doc.isNull()) {
|
||||
Mqtt::publish("sm_data", doc);
|
||||
Mqtt::publish(F("sm_data"), doc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ void Thermostat::publish_values() {
|
||||
|
||||
// send this specific data using the thermostat_data topic
|
||||
if (mqtt_format_ != MQTT_format::NESTED) {
|
||||
Mqtt::publish("thermostat_data", doc);
|
||||
Mqtt::publish(F("thermostat_data"), doc);
|
||||
rootThermostat = doc.to<JsonObject>(); // clear object
|
||||
}
|
||||
}
|
||||
@@ -446,7 +446,7 @@ void Thermostat::publish_values() {
|
||||
|
||||
// if we're using nested json, send all in one go under one topic called thermostat_data
|
||||
if (mqtt_format_ == MQTT_format::NESTED) {
|
||||
Mqtt::publish("thermostat_data", doc);
|
||||
Mqtt::publish(F("thermostat_data"), doc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user