1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-11 07:42:26 +01:00

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

View File

@@ -35,7 +35,7 @@ def validate_adc_pin(value):
if is_esp32c3():
if not (0 <= value <= 4): # ADC1
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.")
elif CORE.is_esp8266:
from esphome.components.esp8266.gpio import CONF_ANALOG