mirror of
https://github.com/esphome/esphome.git
synced 2025-07-28 22:26:36 +00:00
Skip compilation of web_server_v1.cpp when not using version 1 (#9590)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
b2406f9def
commit
44979f0840
@ -317,3 +317,15 @@ async def to_code(config):
|
||||
if (sorting_group_config := config.get(CONF_SORTING_GROUPS)) is not None:
|
||||
cg.add_define("USE_WEBSERVER_SORTING")
|
||||
add_sorting_groups(var, sorting_group_config)
|
||||
|
||||
|
||||
def FILTER_SOURCE_FILES() -> list[str]:
|
||||
"""Filter out web_server_v1.cpp when version is not 1."""
|
||||
files_to_filter: list[str] = []
|
||||
|
||||
# web_server_v1.cpp is only needed when version is 1
|
||||
config = CORE.config.get("web_server", {})
|
||||
if config.get(CONF_VERSION, 2) != 1:
|
||||
files_to_filter.append("web_server_v1.cpp")
|
||||
|
||||
return files_to_filter
|
||||
|
Loading…
x
Reference in New Issue
Block a user