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

Add validate to components (#1631)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Guillermo Ruffino
2021-05-30 19:06:45 -03:00
committed by GitHub
parent 482a3aebc9
commit c79d700d03
16 changed files with 174 additions and 36 deletions

View File

@@ -34,7 +34,7 @@ CHIPSETS = [
]
def validate(value):
def _validate(value):
if value[CONF_CHIPSET] == "NEOPIXEL" and CONF_RGB_ORDER in value:
raise cv.Invalid("NEOPIXEL doesn't support RGB order")
return value
@@ -47,7 +47,7 @@ CONFIG_SCHEMA = cv.All(
cv.Required(CONF_PIN): pins.output_pin,
}
),
validate,
_validate,
)