From 44c2a8310517e9e20cadcfe06cf798a1ad072b1c Mon Sep 17 00:00:00 2001 From: emontnemery Date: Fri, 1 Feb 2019 17:14:02 +0100 Subject: [PATCH] Add PLATFORM_SCHEMA_BASE support to check_config.py (#20663) --- homeassistant/scripts/check_config.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/homeassistant/scripts/check_config.py b/homeassistant/scripts/check_config.py index 50463c28bd1..67bc97da992 100644 --- a/homeassistant/scripts/check_config.py +++ b/homeassistant/scripts/check_config.py @@ -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