mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 01:09:51 +03:00
retain true for MQTT Sensor data in HA
This commit is contained in:
@@ -364,7 +364,7 @@ void Sensor::publish_values() {
|
|||||||
ids.add("ems-esp");
|
ids.add("ems-esp");
|
||||||
|
|
||||||
snprintf_P(&topic[0], 60, PSTR("homeassistant/sensor/ems-esp/dallas_sensor%d/config"), i);
|
snprintf_P(&topic[0], 60, PSTR("homeassistant/sensor/ems-esp/dallas_sensor%d/config"), i);
|
||||||
Mqtt::publish_retain(topic, config.as<JsonObject>(), false); // publish the config payload with no retain flag
|
Mqtt::publish_retain(topic, config.as<JsonObject>(), true); // publish the config payload with retain flag
|
||||||
|
|
||||||
registered_ha_[i] = true;
|
registered_ha_[i] = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user