mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
optimistic only for writable values
This commit is contained in:
@@ -682,7 +682,7 @@ void AnalogSensor::publish_values(const bool force) {
|
||||
|
||||
Mqtt::add_ha_sections_to_doc("analog", stat_t, config, !is_ha_device_created, val_cond);
|
||||
|
||||
if (Mqtt::ha_optimistic()) {
|
||||
if (Mqtt::ha_optimistic() && config["cmd_t"].is<const char*>()) {
|
||||
config["optimistic"] = true;
|
||||
}
|
||||
sensor.ha_registered = Mqtt::queue_ha(topic, config.as<JsonObject>());
|
||||
|
||||
Reference in New Issue
Block a user