mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Allow supported brands in manifests (#67015)
This commit is contained in:
parent
010e6cb4ba
commit
7c7a86242e
@ -248,12 +248,14 @@ MANIFEST_SCHEMA = vol.Schema(
|
|||||||
vol.Optional("loggers"): [str],
|
vol.Optional("loggers"): [str],
|
||||||
vol.Optional("disabled"): str,
|
vol.Optional("disabled"): str,
|
||||||
vol.Optional("iot_class"): vol.In(SUPPORTED_IOT_CLASSES),
|
vol.Optional("iot_class"): vol.In(SUPPORTED_IOT_CLASSES),
|
||||||
|
vol.Optional("supported_brands"): vol.Schema({str: str}),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
CUSTOM_INTEGRATION_MANIFEST_SCHEMA = MANIFEST_SCHEMA.extend(
|
CUSTOM_INTEGRATION_MANIFEST_SCHEMA = MANIFEST_SCHEMA.extend(
|
||||||
{
|
{
|
||||||
vol.Optional("version"): vol.All(str, verify_version),
|
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")
|
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:
|
if not integration.core:
|
||||||
validate_version(integration)
|
validate_version(integration)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user