Add config to allow suppression of warnings about use of strapping pins (#5287)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Clyde Stubbs
2023-10-19 09:04:53 +09:00
committed by GitHub
parent 799c3cf439
commit a794836ebe
10 changed files with 38 additions and 45 deletions
+3 -8
View File
@@ -7,6 +7,7 @@ from esphome.const import (
)
import esphome.config_validation as cv
from esphome.pins import check_strapping_pin
_ESP_32S3_SPI_PSRAM_PINS = {
26: "SPICS1",
@@ -45,14 +46,6 @@ def esp32_s3_validate_gpio_pin(value):
value,
)
if value in _ESP_32S3_STRAPPING_PINS:
_LOGGER.warning(
"GPIO%d is a Strapping PIN and should be avoided.\n"
"Attaching external pullup/down resistors to strapping pins can cause unexpected failures.\n"
"See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins",
value,
)
if value in (22, 23, 24, 25):
# These pins are not exposed in GPIO mux (reason unknown)
# but they're missing from IO_MUX list in datasheet
@@ -71,4 +64,6 @@ def esp32_s3_validate_supports(value):
if is_input:
# All ESP32 pins support input mode
pass
check_strapping_pin(value, _ESP_32S3_STRAPPING_PINS, _LOGGER)
return value