From 19730815297ccc3043ca7aa7165ca076ae2cd8f0 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Wed, 17 Dec 2025 18:11:43 +0100 Subject: [PATCH] ha_dev_section for custom and scheduler --- src/web/WebCustomEntityService.cpp | 4 +--- src/web/WebSchedulerService.cpp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/web/WebCustomEntityService.cpp b/src/web/WebCustomEntityService.cpp index 9dcef0cc5..d04d40fff 100644 --- a/src/web/WebCustomEntityService.cpp +++ b/src/web/WebCustomEntityService.cpp @@ -465,9 +465,7 @@ void WebCustomEntityService::publish(const bool force) { Mqtt::add_ha_classes(config.as(), EMSdevice::DeviceType::SYSTEM, entityItem.value_type, entityItem.uom); - if (!ha_created) { - Mqtt::add_ha_dev_section(config.as(), "Custom Entities", nullptr, "EMS-ESP", EMSESP_APP_VERSION, true); - } + Mqtt::add_ha_dev_section(config.as(), "Custom Entities", nullptr, "EMS-ESP", EMSESP_APP_VERSION, !ha_created); Mqtt::add_ha_avty_section(config.as(), stat_t, val_cond); ha_created |= Mqtt::queue_ha(topic, config.as()); diff --git a/src/web/WebSchedulerService.cpp b/src/web/WebSchedulerService.cpp index 00c8eeb7d..b72b60556 100644 --- a/src/web/WebSchedulerService.cpp +++ b/src/web/WebSchedulerService.cpp @@ -276,9 +276,7 @@ void WebSchedulerService::publish(const bool force) { config["cmd_t"] = command_topic; Mqtt::add_ha_bool(config.as()); - if (!ha_created) { - Mqtt::add_ha_dev_section(config.as(), F_(scheduler), nullptr, "EMS-ESP", EMSESP_APP_VERSION, true); - } + Mqtt::add_ha_dev_section(config.as(), F_(scheduler), nullptr, "EMS-ESP", EMSESP_APP_VERSION, !ha_created); Mqtt::add_ha_avty_section(config.as(), stat_t, val_cond); ha_created |= Mqtt::queue_ha(topic, config.as());