From 8e7841c880ceb192adbeb2a6cec11f448428bdee Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 21 Jun 2025 18:00:17 +0200 Subject: [PATCH] preen --- esphome/core/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esphome/core/config.py b/esphome/core/config.py index 63f2ad4f3b..b8288d534d 100644 --- a/esphome/core/config.py +++ b/esphome/core/config.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging import os from pathlib import Path @@ -43,6 +45,7 @@ from esphome.helpers import ( slugify, walk_files, ) +from esphome.types import ConfigType _LOGGER = logging.getLogger(__name__) @@ -372,7 +375,7 @@ async def _add_platform_reserves() -> None: @coroutine_with_priority(100.0) -async def to_code(config): +async def to_code(config: ConfigType) -> None: cg.add_global(cg.global_ns.namespace("esphome").using) # These can be used by user lambdas, put them to default scope cg.add_global(cg.RawExpression("using std::isnan")) @@ -464,6 +467,7 @@ async def to_code(config): cg.add_define("USE_AREAS") # Handle area configuration + area_conf: dict[str, str] | str | None if area_conf := config.get(CONF_AREA): if isinstance(area_conf, dict): # New way: structured area configuration