mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 16:04:55 +00:00
[esp32] Fix ESP32-C6 pin validator rejecting GPIO 24-30 with wrong error (#15477)
This commit is contained in:
@@ -26,8 +26,8 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def esp32_c6_validate_gpio_pin(value: int) -> int:
|
||||
if value < 0 or value > 23:
|
||||
raise cv.Invalid(f"Invalid pin number: {value} (must be 0-23)")
|
||||
if value < 0 or value > 30:
|
||||
raise cv.Invalid(f"Invalid pin number: {value} (must be 0-30)")
|
||||
if value in _ESP32C6_SPI_PSRAM_PINS:
|
||||
raise cv.Invalid(
|
||||
f"This pin cannot be used on ESP32-C6s and is already used by the SPI/PSRAM interface (function: {_ESP32C6_SPI_PSRAM_PINS[value]})"
|
||||
@@ -47,8 +47,8 @@ def esp32_c6_validate_supports(value: dict[str, Any]) -> dict[str, Any]:
|
||||
mode = value[CONF_MODE]
|
||||
is_input = mode[CONF_INPUT]
|
||||
|
||||
if num < 0 or num > 23:
|
||||
raise cv.Invalid(f"Invalid pin number: {num} (must be 0-23)")
|
||||
if num < 0 or num > 30:
|
||||
raise cv.Invalid(f"Invalid pin number: {num} (must be 0-30)")
|
||||
if is_input:
|
||||
# All ESP32 pins support input mode
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user