From 4d231953f4d793a1f4fd12861eb8532cc66ada37 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 21 Jun 2025 17:57:10 +0200 Subject: [PATCH] preen --- esphome/core/config.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/esphome/core/config.py b/esphome/core/config.py index 00c739b079..23201788ab 100644 --- a/esphome/core/config.py +++ b/esphome/core/config.py @@ -454,14 +454,12 @@ async def to_code(config): CORE.add_job(_add_platformio_options, config[CONF_PLATFORMIO_OPTIONS]) # Count total areas for reservation - total_areas = 0 + total_areas = len(config[CONF_AREAS]) if config.get(CONF_AREA): total_areas += 1 - if areas_list := config.get(CONF_AREAS): - total_areas += len(areas_list) # Reserve space for areas if any are defined - if total_areas > 0: + if total_areas: cg.add(cg.RawStatement(f"App.reserve_area({total_areas});")) cg.add_define("USE_AREAS")