Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions homeassistant/scripts/check_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,14 +345,21 @@ def _comp_error(ex, domain, config):
_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'):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should platform_schema not have a higher priority?
Never used platform_schema_base, not sure what the rules are

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, PLATFORM_SCHEMA_BASE should have higher priority.
Background here: #20224

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
Expand Down