1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-10 13:53:49 +01:00
This commit is contained in:
J. Nick Koston
2025-10-01 22:33:50 +02:00
parent 03e0fbd657
commit 30df2cb9ee

View File

@@ -95,12 +95,9 @@ async def to_code(config):
# Each of these components may create a service at runtime
service_count = sum(
1 for key in ("api", "prometheus", "web_server") if key in CORE.config
)
) + len(config[CONF_SERVICES])
# Count extra services from config
extra_services_count = len(config[CONF_SERVICES])
if extra_services_count > 0:
service_count += extra_services_count
if config[CONF_SERVICES]:
cg.add_define("USE_MDNS_EXTRA_SERVICES")
# Ensure at least 1 service (fallback service)