Skip to content

Commit

Permalink
Check minimum amount of integrations for a brand (home-assistant#124310)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored Aug 22, 2024
1 parent 1d35c74 commit 281a9f0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions script/hassfest/brand.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
}
)

BRAND_EXCEPTIONS = ["u_tec"]


def _validate_brand(
brand: Brand, integrations: dict[str, Integration], config: Config
Expand All @@ -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",
)

Expand Down

0 comments on commit 281a9f0

Please sign in to comment.