apple / HomeKitADK

Apache License 2.0
2.55k stars 232 forks source link

two different lightbulbs one controller #62

Closed Asteliks closed 4 years ago

Asteliks commented 4 years ago

Can I have two different lightbulbs controlled with one controller using HAP? How can I implement that? Could we have more examples besides the lightbulb and the lock?

AustinRobinson commented 4 years ago

I would also find this helpful.

baysinger commented 4 years ago

I think what you need is a bridge accessory, and an example of that is sorely missing from this repo.

See this closed issue for some code snippets: https://github.com/apple/HomeKitADK/issues/32

Basically, you define a new accessory for the bridge, and then you call HAPAccessoryServerStartBridge() instead of HAPAccessoryServerStart(), passing the bridge accessory and a list of the bridged accessories (the two lightbulbs). But definitely see the issue linked above for more details.

Asteliks commented 4 years ago

I have manager to implement it for the ESP32. This might be helpful https://github.com/Asteliks/AppleHomeKitADK-ESP32/tree/master/bridgeTwoLightBulbs

Asteliks commented 4 years ago

Closing the issue as I have solved my problem