From 62c114e849f8dbc4082755d35d841826584162f3 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 28 Sep 2022 16:21:09 -0400 Subject: [PATCH] Add Apple brand (#79227) --- .pre-commit-config.yaml | 2 +- homeassistant/brands/apple.json | 11 +++++ homeassistant/generated/integrations.json | 51 +++++++++++++---------- script/hassfest/brand.py | 6 +-- 4 files changed, 42 insertions(+), 28 deletions(-) create mode 100644 homeassistant/brands/apple.json diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8442d7abecc..088099bf4e4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -106,7 +106,7 @@ repos: pass_filenames: false language: script types: [text] - files: ^(homeassistant/.+/manifest\.json|pyproject\.toml|\.pre-commit-config\.yaml|script/gen_requirements_all\.py)$ + files: ^(homeassistant/.+/manifest\.json|homeassistant/brands/.+\.json|pyproject\.toml|\.pre-commit-config\.yaml|script/gen_requirements_all\.py)$ - id: hassfest name: hassfest entry: script/run-in-env.sh python3 -m script.hassfest diff --git a/homeassistant/brands/apple.json b/homeassistant/brands/apple.json new file mode 100644 index 00000000000..1a782b50900 --- /dev/null +++ b/homeassistant/brands/apple.json @@ -0,0 +1,11 @@ +{ + "domain": "apple", + "name": "Apple", + "integrations": [ + "icloud", + "ibeacon", + "apple_tv", + "homekit", + "homekit_controller" + ] +} diff --git a/homeassistant/generated/integrations.json b/homeassistant/generated/integrations.json index 9cff574ee87..cffcdc28b1e 100644 --- a/homeassistant/generated/integrations.json +++ b/homeassistant/generated/integrations.json @@ -189,10 +189,34 @@ "iot_class": null, "name": "Home Assistant API" }, - "apple_tv": { - "config_flow": true, - "iot_class": "local_push", - "name": "Apple TV" + "apple": { + "name": "Apple", + "integrations": { + "icloud": { + "config_flow": true, + "iot_class": "cloud_polling", + "name": "Apple iCloud" + }, + "ibeacon": { + "config_flow": true, + "iot_class": "local_push", + "name": "iBeacon Tracker" + }, + "apple_tv": { + "config_flow": true, + "iot_class": "local_push", + "name": "Apple TV" + }, + "homekit": { + "config_flow": true, + "iot_class": "local_push", + "name": "HomeKit" + }, + "homekit_controller": { + "config_flow": true, + "iot_class": "local_push" + } + } }, "application_credentials": { "config_flow": false, @@ -1811,15 +1835,6 @@ "iot_class": null, "name": "Home Assistant Alerts" }, - "homekit": { - "config_flow": true, - "iot_class": "local_push", - "name": "HomeKit" - }, - "homekit_controller": { - "config_flow": true, - "iot_class": "local_push" - }, "homematic": { "config_flow": false, "iot_class": "local_push", @@ -1919,16 +1934,6 @@ "iot_class": "cloud_polling", "name": "Jandy iAqualink" }, - "ibeacon": { - "config_flow": true, - "iot_class": "local_push", - "name": "iBeacon Tracker" - }, - "icloud": { - "config_flow": true, - "iot_class": "cloud_polling", - "name": "Apple iCloud" - }, "idteck_prox": { "config_flow": false, "iot_class": "local_push", diff --git a/script/hassfest/brand.py b/script/hassfest/brand.py index 64217da1592..80e2495573e 100644 --- a/script/hassfest/brand.py +++ b/script/hassfest/brand.py @@ -51,10 +51,8 @@ def _validate_brand( f"'{sub_integration}' to 'integrations'", ) - if ( - brand.domain in integrations - and not brand.integrations - or brand.domain not in brand.integrations + if brand.domain in integrations and ( + not brand.integrations or brand.domain not in brand.integrations ): config.add_error( "brand",