mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	preen
This commit is contained in:
		| @@ -454,14 +454,12 @@ async def to_code(config): | |||||||
|         CORE.add_job(_add_platformio_options, config[CONF_PLATFORMIO_OPTIONS]) |         CORE.add_job(_add_platformio_options, config[CONF_PLATFORMIO_OPTIONS]) | ||||||
|  |  | ||||||
|     # Count total areas for reservation |     # Count total areas for reservation | ||||||
|     total_areas = 0 |     total_areas = len(config[CONF_AREAS]) | ||||||
|     if config.get(CONF_AREA): |     if config.get(CONF_AREA): | ||||||
|         total_areas += 1 |         total_areas += 1 | ||||||
|     if areas_list := config.get(CONF_AREAS): |  | ||||||
|         total_areas += len(areas_list) |  | ||||||
|  |  | ||||||
|     # Reserve space for areas if any are defined |     # 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(cg.RawStatement(f"App.reserve_area({total_areas});")) | ||||||
|         cg.add_define("USE_AREAS") |         cg.add_define("USE_AREAS") | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user