Check minimum amount of integrations for a brand (#124310)
parent
1d35c745bb
commit
281a9f042b
|
@ -18,6 +18,8 @@ BRAND_SCHEMA = vol.Schema(
|
|||
}
|
||||
)
|
||||
|
||||
BRAND_EXCEPTIONS = ["u_tec"]
|
||||
|
||||
|
||||
def _validate_brand(
|
||||
brand: Brand, integrations: dict[str, Integration], config: Config
|
||||
|
@ -38,10 +40,14 @@ def _validate_brand(
|
|||
f"Domain '{brand.domain}' does not match file name {brand.path.name}",
|
||||
)
|
||||
|
||||
if not brand.integrations and not brand.iot_standards:
|
||||
if (
|
||||
len(brand.integrations) < 2
|
||||
and not brand.iot_standards
|
||||
and brand.domain not in BRAND_EXCEPTIONS
|
||||
):
|
||||
config.add_error(
|
||||
"brand",
|
||||
f"{brand.path.name}: At least one of integrations or "
|
||||
f"{brand.path.name}: At least two integrations or "
|
||||
"iot_standards must be non-empty",
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue