1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-06 05:12:21 +01:00

Revert "Sort keys in dicts in output yaml for 'config' command (#1049)" (#1191)

This commit is contained in:
Otto Winter
2020-07-25 14:21:56 +02:00
committed by GitHub
parent 32efa5d83e
commit 55388724af
5 changed files with 9 additions and 18 deletions

View File

@@ -186,6 +186,7 @@ def ensure_list(*validators):
None and empty dictionaries are converted to empty lists.
"""
user = All(*validators)
list_schema = Schema([user])
def validator(value):
check_not_templatable(value)
@@ -193,19 +194,7 @@ def ensure_list(*validators):
return []
if not isinstance(value, list):
return [user(value)]
ret = []
errs = []
for i, val in enumerate(value):
try:
with prepend_path([i]):
ret.append(user(val))
except MultipleInvalid as err:
errs.extend(err.errors)
except Invalid as err:
errs.append(err)
if errs:
raise MultipleInvalid(errs)
return ret
return list_schema(value)
return validator
@@ -811,6 +800,7 @@ def mqtt_qos(value):
def requires_component(comp):
"""Validate that this option can only be specified when the component `comp` is loaded."""
# pylint: disable=unsupported-membership-test
def validator(value):
# pylint: disable=unsupported-membership-test
if comp not in CORE.raw_config: