mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Add PLATFORM_SCHEMA_BASE support to check_config.py (#20663)
This commit is contained in:
parent
47d24759f2
commit
44c2a83105
@ -345,14 +345,21 @@ def check_ha_config_file(hass):
|
|||||||
_comp_error(ex, domain, config)
|
_comp_error(ex, domain, config)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not hasattr(component, 'PLATFORM_SCHEMA'):
|
if (not hasattr(component, 'PLATFORM_SCHEMA') and
|
||||||
|
not hasattr(component, 'PLATFORM_SCHEMA_BASE')):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
platforms = []
|
platforms = []
|
||||||
for p_name, p_config in config_per_platform(config, domain):
|
for p_name, p_config in config_per_platform(config, domain):
|
||||||
# Validate component specific platform schema
|
# Validate component specific platform schema
|
||||||
try:
|
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:
|
except vol.Invalid as ex:
|
||||||
_comp_error(ex, domain, config)
|
_comp_error(ex, domain, config)
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user