From e35c2ef66e0901b40279ddf52dd43cc05789ce8d Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Wed, 24 Jun 2026 07:10:52 +1200 Subject: [PATCH] [rp2] Preserve RP2040_BOARD_PINS / RP2040_BASE_PINS aliases for external imports The ``_AliasFinder`` routes legacy ``from esphome.components.rp2040 import boards`` to the canonical rp2 module, but external custom components and tooling (device-builder among them) also reach for the legacy symbol names ``RP2040_BOARD_PINS`` / ``RP2040_BASE_PINS``. Expose them as deprecation-documented aliases of ``RP2_BOARD_PINS`` / ``RP2_BASE_PINS`` so downstream board-pin lookups keep working. Scheduled for removal in 2027.7.0. --- esphome/components/rp2/boards.jinja2 | 9 ++++++++- esphome/components/rp2/boards.py | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/esphome/components/rp2/boards.jinja2 b/esphome/components/rp2/boards.jinja2 index 06ad3a808b..9223009c26 100644 --- a/esphome/components/rp2/boards.jinja2 +++ b/esphome/components/rp2/boards.jinja2 @@ -1,5 +1,5 @@ # Auto-generated by generate_boards.py — do not edit manually -# To regenerate: python esphome/components/rp2040/generate_boards.py +# To regenerate: python esphome/components/rp2/generate_boards.py # arduino-pico maps pins >= {{ cyw43_gpio_offset }} to CYW43 wireless chip GPIOs CYW43_GPIO_OFFSET = {{ cyw43_gpio_offset }} @@ -23,3 +23,10 @@ BOARDS = { }, {%- endfor %} } + +# Deprecated: use RP2_BASE_PINS / RP2_BOARD_PINS instead. Kept as back-compat +# aliases so external custom components / tooling that imported the legacy +# names via the ``rp2040`` package alias keep working. +# Scheduled for removal in 2027.7.0. +RP2040_BASE_PINS = RP2_BASE_PINS +RP2040_BOARD_PINS = RP2_BOARD_PINS diff --git a/esphome/components/rp2/boards.py b/esphome/components/rp2/boards.py index 1609e86eca..94d0ebbb60 100644 --- a/esphome/components/rp2/boards.py +++ b/esphome/components/rp2/boards.py @@ -2299,3 +2299,10 @@ BOARDS = { "max_pin": 29, }, } + +# Deprecated: use RP2_BASE_PINS / RP2_BOARD_PINS instead. Kept as back-compat +# aliases so external custom components / tooling that imported the legacy +# names via the ``rp2040`` package alias keep working. +# Scheduled for removal in 2027.7.0. +RP2040_BASE_PINS = RP2_BASE_PINS +RP2040_BOARD_PINS = RP2_BOARD_PINS