mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +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:
		| @@ -317,3 +317,15 @@ async def to_code(config): | |||||||
|     if (sorting_group_config := config.get(CONF_SORTING_GROUPS)) is not None: |     if (sorting_group_config := config.get(CONF_SORTING_GROUPS)) is not None: | ||||||
|         cg.add_define("USE_WEBSERVER_SORTING") |         cg.add_define("USE_WEBSERVER_SORTING") | ||||||
|         add_sorting_groups(var, sorting_group_config) |         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 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user