Bouke / HAP

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

Async get characteristic #103

Open makleso6 opened 4 years ago

makleso6 commented 4 years ago

Hi! Is it possible to notify that accessory characteristic will/did get and async return new characteristic value (trying to remove overhead with update characteristic by timer)

Bouke commented 4 years ago

I think what you want is tracked by #13. There’s currently no support for that, but I would welcome a PR for that!

makleso6 commented 4 years ago

I'll try to add it

gbrooker commented 4 years ago

This is implemented in Pull request #55

Bouke commented 4 years ago

Beware that updating the characteristic async will return stale data until a refresh is performed. Also if there's no periodic update, any defined triggers based on value thresholds will not fire. So I'd advice to still perform a periodic update with a certain frequency to match your use-case.

makleso6 commented 4 years ago

Yes, periodic update sometimes needed.