From 0b66c24e0866c2addcb021171e507ecf29924825 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Thu, 13 Aug 2026 17:03:30 +1200 Subject: [PATCH] [core] Widen validator input annotations to Any --- esphome/components/openthread/__init__.py | 6 ++++-- esphome/components/shelly_dimmer/light.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/esphome/components/openthread/__init__.py b/esphome/components/openthread/__init__.py index d2e36fd2a0..ab69f5d9ae 100644 --- a/esphome/components/openthread/__init__.py +++ b/esphome/components/openthread/__init__.py @@ -1,3 +1,5 @@ +from typing import Any + from esphome import automation import esphome.codegen as cg from esphome.components.esp32 import ( @@ -78,7 +80,7 @@ CONF_DEVICE_TYPES = [ ] -def _validate_txpower(value: float) -> int | float: +def _validate_txpower(value: Any) -> int | float: if CORE.is_esp32: variant = get_esp32_variant() @@ -205,7 +207,7 @@ def _validate_platform(config: ConfigType) -> ConfigType: )(config) -def _validate_tlv_hex(value: str) -> str: +def _validate_tlv_hex(value: Any) -> str: s = cv.string_strict(value) if len(s) % 2 != 0: raise cv.Invalid("TLV must have an even number of hex characters") diff --git a/esphome/components/shelly_dimmer/light.py b/esphome/components/shelly_dimmer/light.py index b58f5f8067..c166076e0f 100644 --- a/esphome/components/shelly_dimmer/light.py +++ b/esphome/components/shelly_dimmer/light.py @@ -1,6 +1,7 @@ import hashlib from pathlib import Path import re +from typing import Any from esphome import external_files, pins import esphome.codegen as cg @@ -167,7 +168,7 @@ def validate_firmware(value: ConfigType) -> ConfigType: return config -def validate_sha256(value: str) -> str: +def validate_sha256(value: Any) -> str: value = cv.string(value) if not re.fullmatch(r"[0-9a-fA-F]{64}", value): raise ValueError(f"Not a valid SHA256 hex string: {value}")