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(
|
integrations = Integration.load_dir(
|
||||||
pathlib.Path('homeassistant/components')
|
pathlib.Path('homeassistant/components')
|
||||||
)
|
)
|
||||||
manifest.validate(integrations, config)
|
|
||||||
dependencies.validate(integrations, config)
|
for plugin in PLUGINS:
|
||||||
codeowners.validate(integrations, config)
|
plugin.validate(integrations, config)
|
||||||
services.validate(integrations, config)
|
|
||||||
|
|
||||||
# When we generate, all errors that are fixable will be ignored,
|
# When we generate, all errors that are fixable will be ignored,
|
||||||
# as generating them will be fixed.
|
# as generating them will be fixed.
|
||||||
|
@ -59,7 +58,10 @@ def main():
|
||||||
print("Invalid integrations:", len(invalid_itg))
|
print("Invalid integrations:", len(invalid_itg))
|
||||||
|
|
||||||
if not invalid_itg and not general_errors:
|
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
|
return 0
|
||||||
|
|
||||||
print()
|
print()
|
||||||
|
|
|
@ -68,5 +68,5 @@ def validate(integrations: Dict[str, Integration], config):
|
||||||
if dep not in integrations:
|
if dep not in integrations:
|
||||||
integration.add_error(
|
integration.add_error(
|
||||||
'dependencies',
|
'dependencies',
|
||||||
"Dependency {} does not exist"
|
"Dependency {} does not exist".format(dep)
|
||||||
)
|
)
|
||||||
|
|
|
@ -59,7 +59,7 @@ def validate_services(integration: Integration):
|
||||||
"""Validate services."""
|
"""Validate services."""
|
||||||
# Find if integration uses services
|
# Find if integration uses services
|
||||||
has_services = grep_dir(integration.path, "**/*.py",
|
has_services = grep_dir(integration.path, "**/*.py",
|
||||||
r"hass\.(services|async_register)")
|
r"hass\.services\.(register|async_register)")
|
||||||
|
|
||||||
if not has_services:
|
if not has_services:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Reference in a new issue