Skip to content

Commit

Permalink
Add Apple brand (home-assistant#79227)
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob authored Sep 28, 2022
1 parent b49d499 commit 62c114e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions homeassistant/brands/apple.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"domain": "apple",
"name": "Apple",
"integrations": [
"icloud",
"ibeacon",
"apple_tv",
"homekit",
"homekit_controller"
]
}
51 changes: 28 additions & 23 deletions homeassistant/generated/integrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 2 additions & 4 deletions script/hassfest/brand.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 62c114e

Please sign in to comment.