1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-12 14:53:49 +01:00
This commit is contained in:
J. Nick Koston
2025-10-07 21:24:10 -10:00
parent ac7bd4137f
commit 1476dcf5c8
4 changed files with 4 additions and 7 deletions

View File

@@ -5,7 +5,7 @@ namespace dashboard_import {
static std::string g_package_import_url; // NOLINT
std::string get_package_import_url() { return g_package_import_url; }
const std::string &get_package_import_url() { return g_package_import_url; }
void set_package_import_url(std::string url) { g_package_import_url = std::move(url); }
} // namespace dashboard_import

View File

@@ -5,7 +5,7 @@
namespace esphome {
namespace dashboard_import {
std::string get_package_import_url();
const std::string &get_package_import_url();
void set_package_import_url(std::string url);
} // namespace dashboard_import

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: dashboard_import_url
if "dashboard_import" in CORE.config:
dynamic_txt_count += 1
# User-provided templatable TXT values (only lambdas, not static strings)
dynamic_txt_count += sum(
1

View File

@@ -137,8 +137,8 @@ void MDNSComponent::compile_records_() {
#endif // ESPHOME_PROJECT_NAME
#ifdef USE_DASHBOARD_IMPORT
txt_records.push_back({MDNS_STR(TXT_PACKAGE_IMPORT_URL),
MDNS_STR(this->add_dynamic_txt_value(dashboard_import::get_package_import_url()))});
txt_records.push_back(
{MDNS_STR(TXT_PACKAGE_IMPORT_URL), MDNS_STR(dashboard_import::get_package_import_url().c_str())});
#endif
}
#endif // USE_API