Skip validation of defined pins (#3999)

This commit is contained in:
Jens-Christian Skibakk 2022-11-08 07:06:45 +01:00 committed by GitHub
parent 3e110681c9
commit 291deb12ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,6 +105,12 @@ _esp32_validations = {
def validate_gpio_pin(value):
value = _translate_pin(value)
board = CORE.data[KEY_ESP32][KEY_BOARD]
board_pins = boards.ESP32_BOARD_PINS.get(board, {})
if value in board_pins.values():
return value
variant = CORE.data[KEY_ESP32][KEY_VARIANT]
if variant not in _esp32_validations:
raise cv.Invalid(f"Unsupported ESP32 variant {variant}")