From e9d6132c61c5518ee3bb963ce5bf88dc62c1daca Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 21 Aug 2026 20:43:43 -0500 Subject: [PATCH] Name the honored native-arduino pio options once NATIVE_ARDUINO_PIO_OPTIONS is the single list the routing reads; the backend's ignored-option warning consumes it too, so honoring a new key is one edit instead of two synchronized ones. --- esphome/core/config.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/esphome/core/config.py b/esphome/core/config.py index c6463beebb..cbd36e8924 100644 --- a/esphome/core/config.py +++ b/esphome/core/config.py @@ -555,6 +555,12 @@ def _add_library_str(lib: str) -> None: cg.add_library(lib, None) +# platformio_options keys the native ESP8266 Arduino generator honors; the +# backend's ignored-option warning consumes this too so the two lists cannot +# drift (a drift is either a spurious warning or a silently dropped option) +NATIVE_ARDUINO_PIO_OPTIONS = frozenset({"board_build.f_cpu", "board_build.ldscript"}) + + @coroutine_with_priority(CoroPriority.FINAL) async def _add_platformio_options(pio_options: dict[str, str | list[str]]) -> None: if CORE.using_native_toolchain: @@ -593,10 +599,7 @@ async def _add_platformio_options(pio_options: dict[str, str | list[str]]) -> No # platformio/library.py); filters top-level libraries and # discovered dependencies cg.add_platformio_option(key, vals) - elif ( - key in ("board_build.f_cpu", "board_build.ldscript") - and CORE.using_toolchain_arduino - ): + elif key in NATIVE_ARDUINO_PIO_OPTIONS and CORE.using_toolchain_arduino: # Real-world knobs many published ESP8266 configs rely on: # f_cpu 160000000L for timing-sensitive integrations, and a # custom ldscript to reserve a filesystem region or correct