1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-20 18:53:47 +01:00
This commit is contained in:
J. Nick Koston
2025-10-17 15:12:36 -10:00
parent 8762d7cf0e
commit 95a0c9594f
2 changed files with 13 additions and 3 deletions

View File

@@ -238,7 +238,7 @@ def create_detailed_breakdown_table(
# Combine all components from both analyses
all_components = set(target_analysis.keys()) | set(pr_analysis.keys())
# Filter to components that have changed or are significant
# Filter to components that have changed
changed_components = []
for comp in all_components:
target_mem = target_analysis.get(comp, {})
@@ -247,8 +247,8 @@ def create_detailed_breakdown_table(
target_flash = target_mem.get("flash_total", 0)
pr_flash = pr_mem.get("flash_total", 0)
# Include if component has changed or is significant (> 1KB)
if target_flash != pr_flash or target_flash > 1024 or pr_flash > 1024:
# Only include if component has changed
if target_flash != pr_flash:
delta = pr_flash - target_flash
changed_components.append((comp, target_flash, pr_flash, delta))

View File

@@ -67,6 +67,7 @@ def extract_from_compile_output(
# Extract build directory from ESPHome's explicit build path output
# Look for: INFO Compiling app... Build path: /path/to/build
# Note: Multiple builds reuse the same build path (each overwrites the previous)
build_dir = None
if match := re.search(r"Build path: (.+)", output_text):
build_dir = match.group(1).strip()
@@ -226,6 +227,10 @@ def main() -> int:
f"Found {num_builds} builds - summing memory usage across all builds",
file=sys.stderr,
)
print(
"WARNING: Detailed analysis will only cover the last build",
file=sys.stderr,
)
print(f"Total RAM: {ram_bytes} bytes", file=sys.stderr)
print(f"Total Flash: {flash_bytes} bytes", file=sys.stderr)
@@ -235,6 +240,11 @@ def main() -> int:
if detected_build_dir:
print(f"Detected build directory: {detected_build_dir}", file=sys.stderr)
if num_builds > 1:
print(
f" (using last of {num_builds} builds for detailed analysis)",
file=sys.stderr,
)
# Write build directory to file if requested
if args.output_build_dir and build_dir: