Bouke / HAP

Swift implementation of the Homekit Accessory Protocol
https://boukehaarsma.nl/HAP/
MIT License
364 stars 50 forks source link

How to group accessories ? #110

Closed valentindusollier closed 4 years ago

valentindusollier commented 4 years ago

According to 9to5Mac, since iOS 13 we can group sensors (and other accessories) into one tile, and this is automatic.

However the Home app doesn't allow me to do so, I imagine that's because my homebridge doesn't clearly tell HomeKit my thermometer and my hygrometer, for instance, are from the same accessory/objet and have to be grouped.

Is it possible to do so, with this implementation of HAP ?

Bouke commented 4 years ago

This is a single accessory with multiple services. This has been possible from the beginning, but the visual presentation has changed in iOS 13 (the author of the article doesn't seem to be very pleased with it). You can do this like so:

Accessory(info: .init(name: "Sensors", serialNumber: "00004"), type: .sensor, services: [
    .TemperatureSensor(),
    .HumiditySensor()
])
valentindusollier commented 4 years ago

Thank you !