mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	fixes
This commit is contained in:
		| @@ -40,14 +40,7 @@ CONF_SORTING_WEIGHT = "sorting_weight" | |||||||
| OTA_DEFAULT = True | OTA_DEFAULT = True | ||||||
|  |  | ||||||
|  |  | ||||||
| def AUTO_LOAD() -> list[str]: | AUTO_LOAD = ["json", "web_server_base"] | ||||||
|     """Return the components that should be automatically loaded.""" |  | ||||||
|     components = ["json", "web_server_base"] |  | ||||||
|     if CORE.using_esp_idf and CORE.config is not None: |  | ||||||
|         web_server_conf = CORE.config.get(CONF_WEB_SERVER, {}) |  | ||||||
|         if web_server_conf.get(CONF_OTA, OTA_DEFAULT): |  | ||||||
|             components.append("ota") |  | ||||||
|     return components |  | ||||||
|  |  | ||||||
|  |  | ||||||
| web_server_ns = cg.esphome_ns.namespace("web_server") | web_server_ns = cg.esphome_ns.namespace("web_server") | ||||||
| @@ -281,7 +274,8 @@ async def to_code(config): | |||||||
|         cg.add(var.set_css_url(config[CONF_CSS_URL])) |         cg.add(var.set_css_url(config[CONF_CSS_URL])) | ||||||
|         cg.add(var.set_js_url(config[CONF_JS_URL])) |         cg.add(var.set_js_url(config[CONF_JS_URL])) | ||||||
|     cg.add(var.set_allow_ota(config[CONF_OTA])) |     cg.add(var.set_allow_ota(config[CONF_OTA])) | ||||||
|     if config[CONF_OTA]: |     if config[CONF_OTA] and "ota" in CORE.loaded_integrations: | ||||||
|  |         # Only define USE_WEBSERVER_OTA if OTA component is actually loaded | ||||||
|         cg.add_define("USE_WEBSERVER_OTA") |         cg.add_define("USE_WEBSERVER_OTA") | ||||||
|     cg.add(var.set_expose_log(config[CONF_LOG])) |     cg.add(var.set_expose_log(config[CONF_LOG])) | ||||||
|     if config[CONF_ENABLE_PRIVATE_NETWORK_ACCESS]: |     if config[CONF_ENABLE_PRIVATE_NETWORK_ACCESS]: | ||||||
|   | |||||||
| @@ -14,9 +14,8 @@ CONFIG_SCHEMA = cv.All( | |||||||
| async def to_code(config): | async def to_code(config): | ||||||
|     # Increase the maximum supported size of headers section in HTTP request packet to be processed by the server |     # Increase the maximum supported size of headers section in HTTP request packet to be processed by the server | ||||||
|     add_idf_sdkconfig_option("CONFIG_HTTPD_MAX_REQ_HDR_LEN", 1024) |     add_idf_sdkconfig_option("CONFIG_HTTPD_MAX_REQ_HDR_LEN", 1024) | ||||||
|  |  | ||||||
|     # Check if web_server component has OTA enabled |     # Check if web_server component has OTA enabled | ||||||
|     web_server_config = CORE.config.get(CONF_WEB_SERVER, {}) |     web_server_config = CORE.config.get(CONF_WEB_SERVER, {}) | ||||||
|     if web_server_config and web_server_config[CONF_OTA] and "ota" in CORE.config: |     if web_server_config.get(CONF_OTA, True) and "ota" in CORE.loaded_integrations: | ||||||
|         # Add multipart parser component for ESP-IDF OTA support |         # Add multipart parser component for ESP-IDF OTA support | ||||||
|         add_idf_component(name="zorxx/multipart-parser", ref="1.0.1") |         add_idf_component(name="zorxx/multipart-parser", ref="1.0.1") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user