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