Ensure gold and platinum integrations implement diagnostic (#117565)
This commit is contained in:
parent
0335a01fba
commit
996132f3f8
1 changed files with 41 additions and 6 deletions
|
@ -113,6 +113,27 @@ NO_IOT_CLASS = [
|
|||
"websocket_api",
|
||||
"zone",
|
||||
]
|
||||
# Grandfather rule for older integrations
|
||||
# https://github.com/home-assistant/developers.home-assistant/pull/1512
|
||||
NO_DIAGNOSTICS = [
|
||||
"dlna_dms",
|
||||
"fronius",
|
||||
"gdacs",
|
||||
"geonetnz_quakes",
|
||||
"google_assistant_sdk",
|
||||
"hyperion",
|
||||
"modbus",
|
||||
"nightscout",
|
||||
"nws",
|
||||
"point",
|
||||
"pvpc_hourly_pricing",
|
||||
"risco",
|
||||
"smarttub",
|
||||
"songpal",
|
||||
"tellduslive",
|
||||
"vizio",
|
||||
"yeelight",
|
||||
]
|
||||
|
||||
|
||||
def documentation_url(value: str) -> str:
|
||||
|
@ -348,14 +369,28 @@ def validate_manifest(integration: Integration, core_components_dir: Path) -> No
|
|||
"Virtual integration points to non-existing supported_by integration",
|
||||
)
|
||||
|
||||
if (
|
||||
(quality_scale := integration.manifest.get("quality_scale"))
|
||||
and QualityScale[quality_scale.upper()] > QualityScale.SILVER
|
||||
and not integration.manifest.get("codeowners")
|
||||
):
|
||||
if (quality_scale := integration.manifest.get("quality_scale")) and QualityScale[
|
||||
quality_scale.upper()
|
||||
] > QualityScale.SILVER:
|
||||
if not integration.manifest.get("codeowners"):
|
||||
integration.add_error(
|
||||
"manifest",
|
||||
f"{quality_scale} integration does not have a code owner",
|
||||
)
|
||||
if (
|
||||
domain not in NO_DIAGNOSTICS
|
||||
and not (integration.path / "diagnostics.py").exists()
|
||||
):
|
||||
integration.add_error(
|
||||
"manifest",
|
||||
f"{quality_scale} integration does not implement diagnostics",
|
||||
)
|
||||
|
||||
if domain in NO_DIAGNOSTICS and (integration.path / "diagnostics.py").exists():
|
||||
integration.add_error(
|
||||
"manifest",
|
||||
f"{quality_scale} integration does not have a code owner",
|
||||
"Implements diagnostics and can be "
|
||||
"removed from NO_DIAGNOSTICS in script/hassfest/manifest.py",
|
||||
)
|
||||
|
||||
if not integration.core:
|
||||
|
|
Loading…
Add table
Reference in a new issue