1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-17 18:52:19 +01:00
This commit is contained in:
J. Nick Koston
2025-06-22 10:07:05 +02:00
parent a98e34d190
commit b03e3b8d4a

View File

@@ -480,9 +480,9 @@ async def to_code(config: ConfigType) -> None:
cg.add_define("USE_AREAS") cg.add_define("USE_AREAS")
# Handle area configuration # Handle area configuration
area_hashes = dict[int, str] = {} area_hashes: dict[int, str] = {}
area_ids = set[str] = set() area_ids: set[str] = set()
device_hashes = dict[int, str] = {} device_hashes: dict[int, str] = {}
area_conf: dict[str, str] | str | None area_conf: dict[str, str] | str | None
if area_conf := config.get(CONF_AREA): if area_conf := config.get(CONF_AREA):
if isinstance(area_conf, dict): if isinstance(area_conf, dict):
@@ -524,7 +524,7 @@ async def to_code(config: ConfigType) -> None:
cg.add(cg.RawStatement(f"App.reserve_device({len(devices)});")) cg.add(cg.RawStatement(f"App.reserve_device({len(devices)});"))
cg.add_define("USE_DEVICES") cg.add_define("USE_DEVICES")
# Process additional areas # Process additional areas from the areas list
areas: list[dict[str, str]] areas: list[dict[str, str]]
if areas := config[CONF_AREAS]: if areas := config[CONF_AREAS]:
for area_conf in areas: for area_conf in areas: