mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 08:49:52 +03:00
remove optimistic option #2551
This commit is contained in:
@@ -682,9 +682,6 @@ 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() && config["cmd_t"].is<const char*>()) {
|
||||
config["optimistic"] = true;
|
||||
}
|
||||
sensor.ha_registered = Mqtt::queue_ha(topic, config.as<JsonObject>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,6 @@ uint32_t Mqtt::publish_time_heartbeat_;
|
||||
bool Mqtt::mqtt_enabled_;
|
||||
uint8_t Mqtt::entity_format_;
|
||||
bool Mqtt::ha_enabled_;
|
||||
bool Mqtt::ha_optimistic_;
|
||||
uint8_t Mqtt::nested_format_;
|
||||
std::string Mqtt::discovery_prefix_;
|
||||
uint8_t Mqtt::discovery_type_;
|
||||
@@ -341,7 +340,6 @@ void Mqtt::load_settings() {
|
||||
mqtt_retain_ = mqttSettings.mqtt_retain;
|
||||
mqtt_enabled_ = mqttSettings.enabled;
|
||||
ha_enabled_ = mqttSettings.ha_enabled;
|
||||
ha_optimistic_ = mqttSettings.ha_optimistic;
|
||||
nested_format_ = mqttSettings.nested_format;
|
||||
publish_single_ = mqttSettings.publish_single;
|
||||
publish_single2cmd_ = mqttSettings.publish_single2cmd;
|
||||
@@ -1127,9 +1125,6 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
|
||||
|
||||
doc["dev"] = dev_json;
|
||||
|
||||
if (ha_optimistic_ && has_cmd) {
|
||||
doc["optimistic"] = true;
|
||||
}
|
||||
return queue_ha(topic, doc.as<JsonObject>());
|
||||
}
|
||||
|
||||
@@ -1359,9 +1354,6 @@ bool Mqtt::publish_ha_climate_config(const int8_t tag, const bool has_roomtemp,
|
||||
// device name must be different to the entity name, take the ids value we just created
|
||||
add_ha_sections_to_doc("thermostat", topic_t, doc, false, seltemp_cond, has_roomtemp ? currtemp_cond : nullptr, hc_mode_cond);
|
||||
|
||||
if (ha_optimistic_) {
|
||||
doc["optimistic"] = true;
|
||||
}
|
||||
return queue_ha(topic, doc.as<JsonObject>()); // publish the config payload with retain flag
|
||||
}
|
||||
|
||||
|
||||
@@ -210,14 +210,6 @@ class Mqtt {
|
||||
ha_enabled_ = ha_enabled;
|
||||
}
|
||||
|
||||
static bool ha_optimistic() {
|
||||
return ha_optimistic_;
|
||||
}
|
||||
|
||||
static void ha_optimistic(bool ha_optimistic) {
|
||||
ha_optimistic_ = ha_optimistic;
|
||||
}
|
||||
|
||||
static bool ha_climate_reset() {
|
||||
return ha_climate_reset_;
|
||||
}
|
||||
@@ -321,7 +313,6 @@ class Mqtt {
|
||||
static uint32_t publish_time_heartbeat_;
|
||||
static bool mqtt_enabled_;
|
||||
static bool ha_enabled_;
|
||||
static bool ha_optimistic_;
|
||||
static uint8_t nested_format_;
|
||||
static uint8_t entity_format_;
|
||||
static std::string discovery_prefix_;
|
||||
|
||||
Reference in New Issue
Block a user