From 41081b72786e18894ee3a3bce79dcd05170cc0aa Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 15 May 2026 10:29:05 -0700 Subject: [PATCH] [store_yaml] Address review: ConfigType typing and drop redundant priority override - Annotate `_final_validate` and `to_code` with `ConfigType` parameter and return types. - Drop the `get_setup_priority()` override on `StoreYamlComponent`; the default `Component::get_setup_priority()` already returns `setup_priority::DATA`, so the override was a no-op. --- esphome/components/store_yaml/__init__.py | 5 +++-- esphome/components/store_yaml/store_yaml.h | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/components/store_yaml/__init__.py b/esphome/components/store_yaml/__init__.py index 673ca1bb28..0ac2449755 100644 --- a/esphome/components/store_yaml/__init__.py +++ b/esphome/components/store_yaml/__init__.py @@ -11,6 +11,7 @@ import esphome.config_validation as cv from esphome.const import CONF_API, CONF_ID, CONF_RAW_DATA_ID from esphome.core import CORE, EsphomeError, HexInt import esphome.final_validate as fv +from esphome.types import ConfigType _LOGGER = logging.getLogger(__name__) @@ -43,7 +44,7 @@ CONFIG_SCHEMA = cv.Schema( ).extend(cv.COMPONENT_SCHEMA) -def _final_validate(config): +def _final_validate(config: ConfigType) -> ConfigType: """Require API encryption: an unauthenticated client could otherwise pull the embedded YAML (which may include Wi-Fi credentials or opted-in secrets). The escape hatch ``allow_unencrypted_api: true`` exists for @@ -145,7 +146,7 @@ def _pack_envelope(files: list[tuple[str, bytes]]) -> bytes: return b"".join(parts) -async def to_code(config): +async def to_code(config: ConfigType) -> None: cg.add_define("USE_STORE_YAML") zstd = _import_zstd() diff --git a/esphome/components/store_yaml/store_yaml.h b/esphome/components/store_yaml/store_yaml.h index 61f3b87e72..6455dadd23 100644 --- a/esphome/components/store_yaml/store_yaml.h +++ b/esphome/components/store_yaml/store_yaml.h @@ -15,7 +15,6 @@ class StoreYamlComponent : public Component { public: void setup() override; void dump_config() override; - float get_setup_priority() const override { return setup_priority::DATA; } // Called once from codegen with the PROGMEM blob. void set_data(const uint8_t *data, size_t size, size_t uncompressed_size) {