Accept rp2 as a runtime alias of rp2040#1704
Draft
bdraco wants to merge 1 commit into
Draft
Conversation
ESPHome esphome/esphome#17145 renames the rp2040 target platform to rp2; the Platform enum aliases RP2040 onto RP2, so a newer esphome reports the platform string as rp2 (StorageJSON core_platform, CORE.target_platform) while the legacy rp2040: YAML key keeps working. The dashboard sees both names at runtime. Fold rp2 onto the catalog's rp2040 at every boundary that ingests an external platform string: normalize Device.target_platform at load, recognize the rp2: YAML key, and fold in MAC derivation, firmware download routing, remote-build artifact packing, board lookup and component platform-gating. The catalog, manifests and capability index stay keyed on rp2040 until a coordinated esphome bump.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1704 +/- ##
=======================================
Coverage 99.54% 99.54%
=======================================
Files 227 227
Lines 18142 18157 +15
=======================================
+ Hits 18060 18075 +15
Misses 82 82
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Draft
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this implement/fix?
ESPHome is renaming the
rp2040target platform torp2(esphome/esphome#17145); thePlatformenum makesRP2040a Python alias ofRP2, so once a build runs on a newer esphome the platform string everywhere (CORE.target_platform, StorageJSONcore_platform) becomesrp2, while the legacyrp2040:YAML key keeps working as a deprecated alias. The dashboard therefore sees both names at runtime:rp2040from existing devices and YAML, andrp2from anything compiled or written against a newer esphome.This teaches the backend to treat
rp2as an alias ofrp2040. It is purely additive runtime recognition; the generated catalog, board manifests and capability index stay keyed onrp2040(no esphome bump, no catalog regen), and the incomingrp2string is folded ontorp2040at the boundaries that ingest an external platform name.RP2_PLATFORM_ALIASESandnormalize_platform()inmodels/boards.py, reused everywhere.Device.target_platformis normalized at load (_loading.py), so the PLATFORM column and MAC derivation stay consistent for a device that reportsrp2.rp2:YAML key is recognized by the platform scanner; MAC derivation, firmware download-type routing, remote-build artifact packing, board lookup and component platform-gating all foldrp2torp2040.The catalog flip to
rp2(regenerating the catalog, board manifests, thePlatformenum value) is deferred to the future coordinated esphome bump.Related issue or feature (if applicable):
Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocsmaintenancecidependenciesFrontend coordination
A companion frontend PR handles the raw-YAML surfaces (the editor navigator's section categorization and chip icon/label for a user-typed
rp2:block); the catalog-driven wizard and validation paths stay consistent because the catalog remains keyed onrp2040until the future flip.Checklist
ruff,codespell, yaml/json/python checks).tests/where applicable.components.index.json/definitions/components/*.jsonhave not been hand-edited (regenerate viascript/sync_components.pyif a sync is needed).docs/ARCHITECTURE.mdand/ordocs/API.md.