Random hassfest fixes (#23314)
This commit is contained in:
parent
ddb5ff3b71
commit
00d26b3049
3 changed files with 9 additions and 7 deletions
|
@ -35,10 +35,9 @@ def main():
|
|||
integrations = Integration.load_dir(
|
||||
pathlib.Path('homeassistant/components')
|
||||
)
|
||||
manifest.validate(integrations, config)
|
||||
dependencies.validate(integrations, config)
|
||||
codeowners.validate(integrations, config)
|
||||
services.validate(integrations, config)
|
||||
|
||||
for plugin in PLUGINS:
|
||||
plugin.validate(integrations, config)
|
||||
|
||||
# When we generate, all errors that are fixable will be ignored,
|
||||
# as generating them will be fixed.
|
||||
|
@ -59,7 +58,10 @@ def main():
|
|||
print("Invalid integrations:", len(invalid_itg))
|
||||
|
||||
if not invalid_itg and not general_errors:
|
||||
codeowners.generate(integrations, config)
|
||||
for plugin in PLUGINS:
|
||||
if hasattr(plugin, 'generate'):
|
||||
plugin.generate(integrations, config)
|
||||
|
||||
return 0
|
||||
|
||||
print()
|
||||
|
|
|
@ -68,5 +68,5 @@ def validate(integrations: Dict[str, Integration], config):
|
|||
if dep not in integrations:
|
||||
integration.add_error(
|
||||
'dependencies',
|
||||
"Dependency {} does not exist"
|
||||
"Dependency {} does not exist".format(dep)
|
||||
)
|
||||
|
|
|
@ -59,7 +59,7 @@ def validate_services(integration: Integration):
|
|||
"""Validate services."""
|
||||
# Find if integration uses services
|
||||
has_services = grep_dir(integration.path, "**/*.py",
|
||||
r"hass\.(services|async_register)")
|
||||
r"hass\.services\.(register|async_register)")
|
||||
|
||||
if not has_services:
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue