Fix board pin alias lookup (#4147)

This commit is contained in:
Jesse Hills 2022-12-05 19:46:00 +13:00
parent b9720d0715
commit 6911639617
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A

View file

@ -108,6 +108,10 @@ def validate_gpio_pin(value):
board = CORE.data[KEY_ESP32][KEY_BOARD] board = CORE.data[KEY_ESP32][KEY_BOARD]
board_pins = boards.ESP32_BOARD_PINS.get(board, {}) board_pins = boards.ESP32_BOARD_PINS.get(board, {})
# Resolved aliased board pins (shorthand when two boards have the same pin configuration)
while isinstance(board_pins, str):
board_pins = boards.ESP32_BOARD_PINS[board_pins]
if value in board_pins.values(): if value in board_pins.values():
return value return value