tidy up add_ha_dev_section

This commit is contained in:
proddy
2025-12-19 08:55:33 +01:00
parent 179351cb6b
commit ecc6e9286a
6 changed files with 19 additions and 16 deletions

View File

@@ -804,7 +804,7 @@ void AnalogSensor::publish_values(const bool force) {
config["def_ent_id"] = topic_str.substr(0, topic_str.find("/")) + "." + uniq_s;
// dev section with model is only created on the 1st sensor
Mqtt::add_ha_dev_section(config.as<JsonObject>(), "Analog Sensors", nullptr, "EMS-ESP", EMSESP_APP_VERSION, !ha_dev_created);
Mqtt::add_ha_dev_section(config.as<JsonObject>(), "Analog Sensors", !ha_dev_created);
Mqtt::add_ha_avty_section(config.as<JsonObject>(), stat_t, val_cond);
sensor.ha_registered = Mqtt::queue_ha(topic, config.as<JsonObject>());