Allow supported brands in manifests (#67015)

This commit is contained in:
Paulus Schoutsen 2022-02-21 23:42:57 -08:00 committed by GitHub
parent 010e6cb4ba
commit 7c7a86242e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -248,12 +248,14 @@ MANIFEST_SCHEMA = vol.Schema(
vol.Optional("loggers"): [str],
vol.Optional("disabled"): str,
vol.Optional("iot_class"): vol.In(SUPPORTED_IOT_CLASSES),
vol.Optional("supported_brands"): vol.Schema({str: str}),
}
)
CUSTOM_INTEGRATION_MANIFEST_SCHEMA = MANIFEST_SCHEMA.extend(
{
vol.Optional("version"): vol.All(str, verify_version),
vol.Remove("supported_brands"): dict,
}
)
@ -307,6 +309,13 @@ def validate_manifest(integration: Integration, core_components_dir: Path) -> No
):
integration.add_error("manifest", "Domain is missing an IoT Class")
for domain, _name in integration.manifest.get("supported_brands", {}).items():
if (core_components_dir / domain).exists():
integration.add_warning(
"manifest",
f"Supported brand domain {domain} collides with built-in core integration",
)
if not integration.core:
validate_version(integration)