1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00

Language schema 202204 (#3492)

This commit is contained in:
Guillermo Ruffino
2022-06-16 22:46:20 -03:00
committed by GitHub
parent 29d6d0a906
commit f002a23d2d
8 changed files with 188 additions and 904 deletions

View File

@@ -1,4 +1,4 @@
from esphome.jsonschema import jschema_extractor
from esphome.schema_extractors import SCHEMA_EXTRACT, schema_extractor
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation
@@ -479,11 +479,11 @@ async def addressable_flicker_effect_to_code(config, effect_id):
def validate_effects(allowed_effects):
@jschema_extractor("effects")
@schema_extractor("effects")
def validator(value):
# pylint: disable=comparison-with-callable
if value == jschema_extractor:
if value == SCHEMA_EXTRACT:
return (allowed_effects, EFFECTS_REGISTRY)
value = cv.validate_registry("effect", EFFECTS_REGISTRY)(value)
errors = []
names = set()