ewilken / hap-rs

Rust implementation of the Apple HomeKit Accessory Protocol (HAP)
Apache License 2.0
196 stars 33 forks source link

Creating custom characteristics, services & accessories #61

Closed ewilken closed 2 years ago

ewilken commented 2 years ago

We need to validate it being possible with the currently exported API and add an example for it.

gbaranski commented 2 years ago

We need to validate it being possible with the currently exported API and add an example for it.

Hi, what's the status of this issue?

I'm trying to build an accessory that is a sensor which does implements both temperature and humidity and I'm not sure if that's possible.

ewilken commented 2 years ago

The progress of the implementation is tracked here. The work on it slowed down a little over the last weeks due to lack of time, but I'm going to try and get it done soon.

I'm trying to build an accessory that is a sensor which does implements both temperature and humidity and I'm not sure if that's possible.

That's a good question! From a pure HomeKit data model perspective this should be totally doable as an accessory exposing two different sensor services. I'm not sure if an iOS controller is going to accept that as a valid accessory, but I guess it should. Will add an example case testing it out!

ewilken commented 2 years ago

It's indeed working! There you go. :)

cargo run --example custom_multi_sensor
gbaranski commented 2 years ago

It's indeed working! There you go. :)

cargo run --example custom_multi_sensor

awesome, thank you very much.