Fix ADC pin validation on ESP32-C3 (#2551)

This commit is contained in:
Oxan van Leeuwen 2021-10-19 12:56:49 +02:00 committed by GitHub
parent 03cfd78c59
commit 5b5ead872b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,7 +35,7 @@ def validate_adc_pin(value):
if is_esp32c3(): if is_esp32c3():
if not (0 <= value <= 4): # ADC1 if not (0 <= value <= 4): # ADC1
raise cv.Invalid("ESP32-C3: Only pins 0 though 4 support ADC.") raise cv.Invalid("ESP32-C3: Only pins 0 though 4 support ADC.")
if not (32 <= value <= 39): # ADC1 elif not (32 <= value <= 39): # ADC1
raise cv.Invalid("ESP32: Only pins 32 though 39 support ADC.") raise cv.Invalid("ESP32: Only pins 32 though 39 support ADC.")
elif CORE.is_esp8266: elif CORE.is_esp8266:
from esphome.components.esp8266.gpio import CONF_ANALOG from esphome.components.esp8266.gpio import CONF_ANALOG