Add more json schema generation features (#1690)

* some enums

* extract enums, light effects remote_receiver etc

* more pins schema

* update to core changes
This commit is contained in:
Guillermo Ruffino
2021-05-14 20:35:39 -03:00
committed by GitHub
parent 4f6982fbc5
commit 3d6dcc9eee
3 changed files with 60 additions and 9 deletions
+5
View File
@@ -1,3 +1,4 @@
from esphome.jsonschema import jschema_extractor
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation
@@ -452,7 +453,11 @@ def addressable_flicker_effect_to_code(config, effect_id):
def validate_effects(allowed_effects):
@jschema_extractor("effects")
def validator(value):
# pylint: disable=comparison-with-callable
if value == jschema_extractor:
return (allowed_effects, EFFECTS_REGISTRY)
value = cv.validate_registry("effect", EFFECTS_REGISTRY)(value)
errors = []
names = set()