1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-27 14:31:13 +00:00

Use voluptuous for input_slider, input_boolean, input_select (#3256)

* Use voluptuous for input slider

* floats

* _setup_component

* Imperative mood

* CONFIG_SCHEMA

* None returns empty ensure_list

* allow_extra

* bool

* restore ensure_list behaviour
This commit is contained in:
Johann Kellerman
2016-09-23 09:12:11 +02:00
committed by Paulus Schoutsen
parent de51cfbc07
commit 9631179126
9 changed files with 166 additions and 185 deletions

View File

@@ -145,7 +145,7 @@ def prepare_setup_component(hass: core.HomeAssistant, config: dict,
if hasattr(component, 'CONFIG_SCHEMA'):
try:
config = component.CONFIG_SCHEMA(config)
except vol.MultipleInvalid as ex:
except vol.Invalid as ex:
log_exception(ex, domain, config)
return None
@@ -155,8 +155,8 @@ def prepare_setup_component(hass: core.HomeAssistant, config: dict,
# Validate component specific platform schema
try:
p_validated = component.PLATFORM_SCHEMA(p_config)
except vol.MultipleInvalid as ex:
log_exception(ex, domain, p_config)
except vol.Invalid as ex:
log_exception(ex, domain, config)
return None
# Not all platform components follow same pattern for platforms
@@ -176,7 +176,7 @@ def prepare_setup_component(hass: core.HomeAssistant, config: dict,
if hasattr(platform, 'PLATFORM_SCHEMA'):
try:
p_validated = platform.PLATFORM_SCHEMA(p_validated)
except vol.MultipleInvalid as ex:
except vol.Invalid as ex:
log_exception(ex, '{}.{}'.format(domain, p_name),
p_validated)
return None