Config Validator: schema_with_slug_keys (#20298)

* schema_with_slug_keys

* Update config_validation.py

* Update config_validation.py
This commit is contained in:
Johann Kellerman authored and Paulus Schoutsen committed 2019-01-21 16:36:04 -08:00
1 parent 4b3cdb9f4e
commit 6511e11ec9
38 files changed
+66 -66

No files matched your search

+4 -3
View File
@@ -64,14 +64,15 @@ def _cv_input_select(cfg):
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
cv.slug: vol.All({
DOMAIN: cv.schema_with_slug_keys(
vol.All({
vol.Optional(CONF_NAME): cv.string,
vol.Required(CONF_OPTIONS):
vol.All(cv.ensure_list, vol.Length(min=1), [cv.string]),
vol.Optional(CONF_INITIAL): cv.string,
vol.Optional(CONF_ICON): cv.icon,
}, _cv_input_select)})
}, _cv_input_select)
)
}, required=True, extra=vol.ALLOW_EXTRA)