[rp2040_pio_led_strip][rp2040_pio] Fix CUSTOM chipset crash and improve error message (#15537)

This commit is contained in:
Jonathan Swoboda
2026-04-07 17:56:50 -04:00
committed by GitHub
parent 97ad5ab35f
commit 9fe4d5c63d
2 changed files with 8 additions and 2 deletions
+8 -1
View File
@@ -1,6 +1,7 @@
import platform
import esphome.codegen as cg
import esphome.config_validation as cv
DEPENDENCIES = ["rp2040"]
@@ -31,7 +32,13 @@ async def to_code(config):
# "earlephilhower/tool-pioasm-rp2040-earlephilhower",
# ],
# )
file = PIOASM_DOWNLOADS[platform.system().lower()][platform.machine().lower()]
os_name = platform.system().lower()
arch = platform.machine().lower()
if os_name not in PIOASM_DOWNLOADS or arch not in PIOASM_DOWNLOADS[os_name]:
raise cv.Invalid(
f"pioasm is not available for {platform.system()} {platform.machine()}"
)
file = PIOASM_DOWNLOADS[os_name][arch]
cg.add_platformio_option(
"platform_packages",
[f"earlephilhower/tool-pioasm-rp2040-earlephilhower@{PIOASM_REPO_BASE}/{file}"],
@@ -148,7 +148,6 @@ CHIPSETS = {
"WS2812B": Chipset.CHIPSET_WS2812B,
"SK6812": Chipset.CHIPSET_SK6812,
"SM16703": Chipset.CHIPSET_SM16703,
"CUSTOM": Chipset.CHIPSET_CUSTOM,
}