diff --git a/esphome/components/esp8266/__init__.py b/esphome/components/esp8266/__init__.py index bef7e36470a..6a72bb429ee 100644 --- a/esphome/components/esp8266/__init__.py +++ b/esphome/components/esp8266/__init__.py @@ -264,7 +264,14 @@ async def to_code(config): cg.add_platformio_option("platform", conf[CONF_PLATFORM_VERSION]) cg.add_platformio_option( "platform_packages", - [f"platformio/framework-arduinoespressif8266@{conf[CONF_SOURCE]}"], + [ + f"platformio/framework-arduinoespressif8266@{conf[CONF_SOURCE]}", + # Override the ancient tool-esptoolpy ~1.30000.0 pinned by + # platform-espressif8266 4.2.1 with the same 5.x build the + # pioarduino ESP32 platform uses, so both platforms share the + # same installed package and stop reinstalling on every switch. + "pioarduino/tool-esptoolpy@https://github.com/pioarduino/registry/releases/download/0.0.1/esptoolpy-v5.2.0.zip", + ], ) # Default for platformio is LWIP2_LOW_MEMORY with: