mirror of
https://github.com/esphome/esphome.git
synced 2025-10-29 22:24:26 +00:00
preen
This commit is contained in:
@@ -18,6 +18,8 @@ CODEOWNERS = ["@esphome/core"]
|
||||
DEPENDENCIES = ["network"]
|
||||
|
||||
# Components that create mDNS services at runtime
|
||||
# IMPORTANT: If you add a new component here, you must also update the corresponding
|
||||
# #ifdef blocks in mdns_component.cpp compile_records_() method
|
||||
COMPONENTS_WITH_MDNS_SERVICES = ("api", "prometheus", "web_server")
|
||||
|
||||
mdns_ns = cg.esphome_ns.namespace("mdns")
|
||||
|
||||
@@ -75,6 +75,9 @@ void MDNSComponent::compile_records_() {
|
||||
this->hostname_ = App.get_name();
|
||||
this->services_count_ = 0;
|
||||
|
||||
// IMPORTANT: The #ifdef blocks below must match COMPONENTS_WITH_MDNS_SERVICES
|
||||
// in mdns/__init__.py. If you add a new service here, update both locations.
|
||||
|
||||
#ifdef USE_API
|
||||
if (api::global_api_server != nullptr) {
|
||||
auto &service = this->services_[this->services_count_++];
|
||||
|
||||
Reference in New Issue
Block a user