1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-11 22:33:49 +01:00

limit 8266 to 10

This commit is contained in:
J. Nick Koston
2025-10-10 08:52:52 -10:00
parent b73c477a39
commit a2f7e898a9

View File

@@ -38,6 +38,14 @@ from script.analyze_component_buses import (
)
from script.merge_component_configs import merge_component_configs
# Platform-specific maximum group sizes
# ESP8266 has limited IRAM and can't handle large component groups
PLATFORM_MAX_GROUP_SIZE = {
"esp8266-ard": 10, # ESP8266 Arduino has limited IRAM
"esp8266-idf": 10, # ESP8266 IDF also has limited IRAM
# Other platforms can handle larger groups
}
def show_disk_space_if_ci(esphome_command: str) -> None:
"""Show disk space usage if running in CI during compile.
@@ -525,6 +533,28 @@ def run_grouped_component_tests(
# No other groups for this platform - keep no_buses components together
grouped_components[(platform, NO_BUSES_SIGNATURE)] = no_buses_comps
# Split groups that exceed platform-specific maximum sizes
# ESP8266 has limited IRAM and can't handle large component groups
split_groups = {}
for (platform, signature), components in list(grouped_components.items()):
max_size = PLATFORM_MAX_GROUP_SIZE.get(platform)
if max_size and len(components) > max_size:
# Split this group into smaller groups
print(
f"\n Splitting {platform} group (signature: {signature}) "
f"from {len(components)} to max {max_size} components per group"
)
# Remove original group
del grouped_components[(platform, signature)]
# Create split groups
for i in range(0, len(components), max_size):
split_components = components[i : i + max_size]
# Create unique signature for each split group
split_signature = f"{signature}_split{i // max_size + 1}"
split_groups[(platform, split_signature)] = split_components
# Add split groups back
grouped_components.update(split_groups)
groups_to_test = []
individual_tests = set() # Use set to avoid duplicates