diff --git a/esphome/components/web_server/__init__.py b/esphome/components/web_server/__init__.py index 72612a5641..29fa669530 100644 --- a/esphome/components/web_server/__init__.py +++ b/esphome/components/web_server/__init__.py @@ -32,6 +32,7 @@ from esphome.const import ( PLATFORM_RTL87XX, ) from esphome.core import CORE, coroutine_with_priority +from esphome.cpp_types import ConfigType import esphome.final_validate as fv AUTO_LOAD = ["json", "web_server_base"] @@ -47,7 +48,7 @@ WebServer = web_server_ns.class_("WebServer", cg.Component, cg.Controller) sorting_groups = {} -def default_url(config): +def default_url(config: ConfigType) -> ConfigType: config = config.copy() if config[CONF_VERSION] == 1: if CONF_CSS_URL not in config: @@ -67,13 +68,13 @@ def default_url(config): return config -def validate_local(config): +def validate_local(config: ConfigType) -> ConfigType: if CONF_LOCAL in config and config[CONF_VERSION] == 1: raise cv.Invalid("'local' is not supported in version 1") return config -def validate_ota_removed(config): +def validate_ota_removed(config: dict) -> dict: # Only raise error if OTA is explicitly enabled (True) # If it's False or not specified, we can safely ignore it if config.get(CONF_OTA): @@ -87,7 +88,7 @@ def validate_ota_removed(config): return config -def validate_sorting_groups(config): +def validate_sorting_groups(config: dict) -> dict: if CONF_SORTING_GROUPS in config and config[CONF_VERSION] != 3: raise cv.Invalid( f"'{CONF_SORTING_GROUPS}' is only supported in 'web_server' version 3" diff --git a/tests/components/ota_base/common.yaml b/tests/components/ota_base/common.yaml deleted file mode 100644 index 9b680b7c18..0000000000 --- a/tests/components/ota_base/common.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# Test that ota_base compiles correctly as a dependency -# This component is typically auto-loaded by other components - -wifi: - ssid: MySSID - password: password1 - -ota: - - platform: esphome - password: "test1234" diff --git a/tests/components/ota_base/test.esp32-idf.yaml b/tests/components/ota_base/test.esp32-idf.yaml deleted file mode 100644 index dade44d145..0000000000 --- a/tests/components/ota_base/test.esp32-idf.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include common.yaml