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 Jesse Hills
parent 6ef57a2973
commit 3a760fbb44
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A

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