From 1d2e41371a08da4c5c0a7bb686ac19e09bfdb4c6 Mon Sep 17 00:00:00 2001 From: David Rothenberger Date: Fri, 5 Dec 2025 11:14:49 -0800 Subject: [PATCH] fix: use the node name to find the compilation output If the device YAML specifies a name that is different from the name of the YAML file, `esphome compile` will use the *node name* for the output directory and firmware file, not the name of the YAML file. --- esphome_selective_updates/esphome_smart_updater.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/esphome_selective_updates/esphome_smart_updater.py b/esphome_selective_updates/esphome_smart_updater.py index c047498..51332f0 100644 --- a/esphome_selective_updates/esphome_smart_updater.py +++ b/esphome_selective_updates/esphome_smart_updater.py @@ -405,7 +405,8 @@ def needs_update(device_name: str, progress: Dict) -> Tuple[bool, str]: def compile_in_esphome_container( container: str, yaml_name: str, - device_name: str + device_name: str, + node: str ) -> Optional[str]: """ Compile firmware in ESPHome container @@ -428,8 +429,8 @@ def compile_in_esphome_container( # Locate compiled binary stem = Path(yaml_name).stem - pio_bin = f"/data/build/{stem}*/.pioenvs/{stem}*/firmware.bin" - legacy = f"/config/esphome/.esphome/build/{stem}/{stem}.bin" + pio_bin = f"/data/build/{node}*/.pioenvs/{node}*/firmware.bin" + legacy = f"/config/esphome/.esphome/build/{node}/{node}.bin" dst_dir = Path("/config/esphome/builds") dst_dir.mkdir(parents=True, exist_ok=True) @@ -794,7 +795,7 @@ def update_device( log(f"→ Starting update for {name}") # Compile - bin_path = compile_in_esphome_container(container, yaml_name, name) + bin_path = compile_in_esphome_container(container, yaml_name, name, node) if STOP_REQUESTED: log("Stop requested during compile") return "skipped"