ha_dev_section for custom and scheduler

This commit is contained in:
MichaelDvP
2025-12-17 18:11:43 +01:00
parent 45ae6d802c
commit 1973081529
2 changed files with 2 additions and 6 deletions

View File

@@ -276,9 +276,7 @@ void WebSchedulerService::publish(const bool force) {
config["cmd_t"] = command_topic;
Mqtt::add_ha_bool(config.as<JsonObject>());
if (!ha_created) {
Mqtt::add_ha_dev_section(config.as<JsonObject>(), F_(scheduler), nullptr, "EMS-ESP", EMSESP_APP_VERSION, true);
}
Mqtt::add_ha_dev_section(config.as<JsonObject>(), F_(scheduler), nullptr, "EMS-ESP", EMSESP_APP_VERSION, !ha_created);
Mqtt::add_ha_avty_section(config.as<JsonObject>(), stat_t, val_cond);
ha_created |= Mqtt::queue_ha(topic, config.as<JsonObject>());