[web_server] Keep AUTO_LOAD static so web_server_base loads before ota.web_server

This commit is contained in:
J. Nick Koston
2026-08-19 14:21:17 -05:00
parent d88a95c3f6
commit 55180938ca
+4 -2
View File
@@ -48,11 +48,13 @@ from esphome.types import ConfigType
_LOGGER = logging.getLogger(__name__)
def AUTO_LOAD(config: ConfigType) -> list[str]:
def AUTO_LOAD() -> list[str]:
# No config parameter on purpose: that would make this a late (dynamic) auto-load and
# ota.web_server's dependency on web_server_base would not be satisfied in time.
auto_load = ["json", "web_server_base"]
# The AP mode DNS server (web_server_base/dns_server_esp32_idf) uses socket; only
# configs with a WiFi access point can end up in AP mode.
wifi = CORE.raw_config.get(CONF_WIFI) if CORE.raw_config is not None else None
wifi = CORE.raw_config.get(CONF_WIFI) if CORE.raw_config else None
if CORE.is_esp32 and (not isinstance(wifi, dict) or CONF_AP in wifi):
auto_load.append("socket")
return auto_load