Add PLATFORM_SCHEMA_BASE support to check_config.py (#20663)

pull/20794/head
emontnemery 2019-02-01 17:14:02 +01:00 committed by Paulus Schoutsen
parent 47660f9312
commit c702e1e3c6
1 changed files with 9 additions and 2 deletions

View File

@ -345,14 +345,21 @@ def check_ha_config_file(hass):
_comp_error(ex, domain, config)
continue
if not hasattr(component, 'PLATFORM_SCHEMA'):
if (not hasattr(component, 'PLATFORM_SCHEMA') and
not hasattr(component, 'PLATFORM_SCHEMA_BASE')):
continue
platforms = []
for p_name, p_config in config_per_platform(config, domain):
# Validate component specific platform schema
try:
p_validated = component.PLATFORM_SCHEMA(p_config)
if hasattr(component, 'PLATFORM_SCHEMA_BASE'):
p_validated = \
component.PLATFORM_SCHEMA_BASE( # type: ignore
p_config)
else:
p_validated = component.PLATFORM_SCHEMA( # type: ignore
p_config)
except vol.Invalid as ex:
_comp_error(ex, domain, config)
continue