diff --git a/esphome/components/esp32/__init__.py b/esphome/components/esp32/__init__.py index 8c052acc87..d3c343b9db 100644 --- a/esphome/components/esp32/__init__.py +++ b/esphome/components/esp32/__init__.py @@ -1440,6 +1440,10 @@ async def to_code(config): # Avoids persistent corrupted cache from mid-stream download failures. os.environ["UV_CACHE_DIR"] = str(CORE.relative_internal_path(".uv_cache")) + # Set the uv cache inside the data dir so "Clean All" clears it. + # Avoids persistent corrupted cache from mid-stream download failures. + os.environ["UV_CACHE_DIR"] = str(CORE.relative_internal_path(".uv_cache")) + if conf[CONF_TYPE] == FRAMEWORK_ESP_IDF: cg.add_build_flag("-DUSE_ESP_IDF") cg.add_build_flag("-DUSE_ESP32_FRAMEWORK_ESP_IDF")