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());