mirror of
https://github.com/esphome/esphome.git
synced 2025-10-11 14:23:47 +01:00
preen
This commit is contained in:
@@ -92,19 +92,10 @@ async def to_code(config):
|
|||||||
cg.add_define("USE_MDNS")
|
cg.add_define("USE_MDNS")
|
||||||
|
|
||||||
# Calculate compile-time service count
|
# Calculate compile-time service count
|
||||||
service_count = 0
|
# Each of these components may create a service at runtime
|
||||||
|
service_count = sum(
|
||||||
# Check if API component is enabled (it may create a service at runtime)
|
1 for key in ("api", "prometheus", "web_server") if key in CORE.config
|
||||||
if "api" in CORE.config:
|
)
|
||||||
service_count += 1
|
|
||||||
|
|
||||||
# Check for prometheus
|
|
||||||
if "prometheus" in CORE.config:
|
|
||||||
service_count += 1
|
|
||||||
|
|
||||||
# Check for web_server
|
|
||||||
if "web_server" in CORE.config:
|
|
||||||
service_count += 1
|
|
||||||
|
|
||||||
# Count extra services from config
|
# Count extra services from config
|
||||||
extra_services_count = len(config[CONF_SERVICES])
|
extra_services_count = len(config[CONF_SERVICES])
|
||||||
|
Reference in New Issue
Block a user