mirror of
https://github.com/esphome/esphome.git
synced 2025-09-16 18:22:22 +01:00
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:
@@ -9,6 +9,7 @@ from esphome.const import (
|
||||
CONF_PULLUP,
|
||||
)
|
||||
import esphome.config_validation as cv
|
||||
from esphome.pins import check_strapping_pin
|
||||
|
||||
|
||||
_ESP_SDIO_PINS = {
|
||||
@@ -35,13 +36,6 @@ def esp32_validate_gpio_pin(value):
|
||||
"flash interface in QUAD IO flash mode.",
|
||||
value,
|
||||
)
|
||||
if value in _ESP32_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 (24, 28, 29, 30, 31):
|
||||
# These pins are not exposed in GPIO mux (reason unknown)
|
||||
# but they're missing from IO_MUX list in datasheet
|
||||
@@ -74,4 +68,5 @@ def esp32_validate_supports(value):
|
||||
f"GPIO{num} (34-39) does not support pulldowns.", [CONF_MODE, CONF_PULLDOWN]
|
||||
)
|
||||
|
||||
check_strapping_pin(value, _ESP32_STRAPPING_PINS, _LOGGER)
|
||||
return value
|
||||
|
Reference in New Issue
Block a user