1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00
This commit is contained in:
J. Nick Koston
2025-10-07 21:22:34 -10:00
parent 52f2826d38
commit ac7bd4137f
2 changed files with 1 additions and 4 deletions

View File

@@ -123,9 +123,6 @@ async def to_code(config):
if "api" in CORE.config:
# Always: get_mac_address()
dynamic_txt_count += 1
# Conditional: friendly_name (if not empty)
if CORE.friendly_name:
dynamic_txt_count += 1
# Conditional: dashboard_import_url
if "dashboard_import" in CORE.config:
dynamic_txt_count += 1

View File

@@ -97,7 +97,7 @@ void MDNSComponent::compile_records_() {
txt_records.reserve(txt_count);
if (!friendly_name_empty) {
txt_records.push_back({MDNS_STR(TXT_FRIENDLY_NAME), MDNS_STR(this->add_dynamic_txt_value(friendly_name))});
txt_records.push_back({MDNS_STR(TXT_FRIENDLY_NAME), MDNS_STR(friendly_name.c_str())});
}
txt_records.push_back({MDNS_STR(TXT_VERSION), MDNS_STR(ESPHOME_VERSION)});
txt_records.push_back({MDNS_STR(TXT_MAC), MDNS_STR(this->add_dynamic_txt_value(get_mac_address()))});