Use upstream constants when defining homekit service to platform mapping (#65272)

This commit is contained in:
Jc2k 2022-01-30 22:59:01 +00:00 committed by GitHub
parent 58f624a3da
commit eb94fe1ca7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 29 deletions

View file

@ -494,7 +494,11 @@ class HKDevice:
tasks = []
for accessory in self.accessories:
for service in accessory["services"]:
stype = ServicesTypes.get_short(service["type"].upper())
try:
stype = ServicesTypes.get_short_uuid(service["type"].upper())
except KeyError:
stype = service["type"].upper()
if stype in HOMEKIT_ACCESSORY_DISPATCH:
platform = HOMEKIT_ACCESSORY_DISPATCH[stype]
if platform not in self.platforms: