From 20c65f70ed81fbad0dcda17efb85f7f873582c2b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 19 Oct 2025 14:47:19 -1000 Subject: [PATCH] wip --- esphome/platformio_api.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/esphome/platformio_api.py b/esphome/platformio_api.py index ee515a171f..5d5c842e84 100644 --- a/esphome/platformio_api.py +++ b/esphome/platformio_api.py @@ -50,15 +50,18 @@ def patch_file_downloader(): # Import our cache module from esphome.github_cache import GitHubCache - _LOGGER.info("Applying GitHub download cache patch...") + _LOGGER.debug("Applying GitHub download cache patch...") original_init = FileDownloader.__init__ original_start = FileDownloader.start # Initialize cache in .platformio directory so it benefits from GitHub Actions cache platformio_dir = Path.home() / ".platformio" - cache = GitHubCache(cache_dir=platformio_dir / "esphome_download_cache") - _LOGGER.info("GitHub download cache initialized at: %s", cache.cache_dir) + cache_dir = platformio_dir / "esphome_download_cache" + cache_dir_existed = cache_dir.exists() + cache = GitHubCache(cache_dir=cache_dir) + if not cache_dir_existed: + _LOGGER.info("Created GitHub download cache at: %s", cache.cache_dir) def patched_init(self, *args, **kwargs): """Patched init that checks cache before making HTTP connection."""