mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-26 16:49:11 +03:00
publish ha only if ha is enabled
This commit is contained in:
@@ -383,12 +383,6 @@ void WebCustomEntityService::publish() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Mqtt::publish_single()) {
|
||||
for (CustomEntityItem & entityItem : *customEntityItems_) {
|
||||
publish_single(entityItem);
|
||||
}
|
||||
}
|
||||
|
||||
JsonDocument doc;
|
||||
JsonObject output = doc.to<JsonObject>();
|
||||
bool ha_created = ha_configdone_;
|
||||
@@ -399,7 +393,7 @@ void WebCustomEntityService::publish() {
|
||||
}
|
||||
render_value(output, entityItem);
|
||||
// create HA config
|
||||
if (!ha_configdone_) {
|
||||
if (Mqtt::ha_enabled() && !ha_configdone_) {
|
||||
JsonDocument config;
|
||||
config["~"] = Mqtt::base();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user