Fix neopixelbus missing method pins (#848)

Fixes https://github.com/esphome/issues/issues/839
This commit is contained in:
Otto Winter 2019-11-12 18:59:23 +01:00
parent b3094d6a53
commit 7752794fc5
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E

View File

@ -74,7 +74,11 @@ def validate_method_pin(value):
method_pins['BIT_BANG'] = list(range(0, 16)) method_pins['BIT_BANG'] = list(range(0, 16))
elif CORE.is_esp32: elif CORE.is_esp32:
method_pins['BIT_BANG'] = list(range(0, 32)) method_pins['BIT_BANG'] = list(range(0, 32))
pins_ = method_pins[method] pins_ = method_pins.get(method)
if pins_ is None:
# all pins allowed for this method
return value
for opt in (CONF_PIN, CONF_CLOCK_PIN, CONF_DATA_PIN): for opt in (CONF_PIN, CONF_CLOCK_PIN, CONF_DATA_PIN):
if opt in value and value[opt] not in pins_: if opt in value and value[opt] not in pins_:
raise cv.Invalid("Method {} only supports pin(s) {}".format( raise cv.Invalid("Method {} only supports pin(s) {}".format(