mirror of
https://github.com/esphome/esphome.git
synced 2025-10-12 23:03:46 +01:00
preen
This commit is contained in:
@@ -5,7 +5,7 @@ namespace dashboard_import {
|
|||||||
|
|
||||||
static std::string g_package_import_url; // NOLINT
|
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); }
|
void set_package_import_url(std::string url) { g_package_import_url = std::move(url); }
|
||||||
|
|
||||||
} // namespace dashboard_import
|
} // namespace dashboard_import
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace dashboard_import {
|
namespace dashboard_import {
|
||||||
|
|
||||||
std::string get_package_import_url();
|
const std::string &get_package_import_url();
|
||||||
void set_package_import_url(std::string url);
|
void set_package_import_url(std::string url);
|
||||||
|
|
||||||
} // namespace dashboard_import
|
} // namespace dashboard_import
|
||||||
|
@@ -123,9 +123,6 @@ async def to_code(config):
|
|||||||
if "api" in CORE.config:
|
if "api" in CORE.config:
|
||||||
# Always: get_mac_address()
|
# Always: get_mac_address()
|
||||||
dynamic_txt_count += 1
|
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)
|
# User-provided templatable TXT values (only lambdas, not static strings)
|
||||||
dynamic_txt_count += sum(
|
dynamic_txt_count += sum(
|
||||||
1
|
1
|
||||||
|
@@ -137,8 +137,8 @@ void MDNSComponent::compile_records_() {
|
|||||||
#endif // ESPHOME_PROJECT_NAME
|
#endif // ESPHOME_PROJECT_NAME
|
||||||
|
|
||||||
#ifdef USE_DASHBOARD_IMPORT
|
#ifdef USE_DASHBOARD_IMPORT
|
||||||
txt_records.push_back({MDNS_STR(TXT_PACKAGE_IMPORT_URL),
|
txt_records.push_back(
|
||||||
MDNS_STR(this->add_dynamic_txt_value(dashboard_import::get_package_import_url()))});
|
{MDNS_STR(TXT_PACKAGE_IMPORT_URL), MDNS_STR(dashboard_import::get_package_import_url().c_str())});
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif // USE_API
|
#endif // USE_API
|
||||||
|
Reference in New Issue
Block a user