-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Batch updating? #164
Comments
This library currently doesn't distinguish between a single command or a batch of commands. The callback function (see example) is called for every characteristics which is included in the command from the client. What you could do is to collect those commands over a period of time (eg. 50ms) and then send them via Z-Wave to the actual devices. |
I was thinking about adding an "Accessory Updated" event callback around here: https://github.com/brutella/hc/blob/master/hap/controller/characteristic_controller.go#L93 This could either take Does that sound good? |
Looking at the protocol it seems that it might be possible to capture a batch of updates destined for an Accessory. Currently all the HomeKit libraries just distribute the characteristic updates to each service making it difficult to know if it came from a batch or a single request.
What I mean by "batch" is lets say you issues a Siri command "Hey Siri, Turn Off all the Lights". From what I can tell iOS collects all the changes and sends it to the Bridge Accessory responsible for those lights. Compared to "Hey Siri, Turn Off the Living Room Light" would be a single update.
The reason why I am looking into this is because issuing multiple requests over the Z-Wave protocol is expensive. If you have 20 lights to turn off it takes a long time to complete the request.
With the Z-Wave protocol you can broadcast a command to the entire network. And one thing I'm specifically looking into is multicast (addressing a range of devices). If I was able to get HomeKit to give me a batch of updates I could compose a single command rather than 20.
Does this sound about right? If so, is this something you would accept the PR for?
The text was updated successfully, but these errors were encountered: