-
Notifications
You must be signed in to change notification settings - Fork 34
Added support to send multiple commands to multiple devices at once #1748
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
base: main
Are you sure you want to change the base?
Conversation
|
Thanks for your contribution @CZDave! Would it be an idea to first implement this in the Home Assistant core integration, and merge this one when you have found a good implementation? This would make it easier to make changes to pyoverkiz if needed, as we prefer to not have breaking changes after release. You can point Home Assistant to your current feature branch. |
|
My personal preference is to revamp the action executions in this library anyways, and make it better typed and have a single function that can do one or multiple calls. |
|
Hi @iMicknl, this is my current work in progress for the HA core: home-assistant/core@dev...CZDave:ha-core:overkiz-covers-batch-commands I've got a few batch services ready there, they support both regular covers and cover group helpers, so you can create a group of multiple covers in HA and then call for example batch_set_cover_position on the whole group with one API request. I plan to create a PR from that branch soon, but it won't work without this PR for pyoverkiz. I think these shouldn't be breaking changes. Please let me know if you think this is a good idea or not. Thanks in advance! |
|
Thanks @CZDave, this would be a good quick workaround, but such additional services won't be accepted in Home Assistant core. You will need to implement some kind of queuing mechanism in the integration (or underlying package), where all normal HA services/features can be used, but the batching is taken care of automatically. |
|
I see. In that case I think you can close this PR. Thank you for taking your time on this. I'll see if I can find some time to look into implementing an automatic queueing mechanism. If I'm able to implement that in the integration, would you consider pulling something like this PR to pyoverkiz to support it? Or would you rather have some revamped version as you mentioned first? |
|
An automatic queuing mechanism would definitely be accepted! Here I am not sure yet if we should have this in the Overkiz integration in Home Assistant or in the underlying library, perhaps having it in this library might even be better. The command execution is quite barebones at the moment, which causes some limitations when running multiple automations and also the code is not great typed I would say.. Feel free to ping me on Discord as well ( |
|
Apologies for the delay @CZDave! I will review this in more detail in the coming weeks, and I am also looking if we can rewrite parts of this library (with breaking changes) for a v2. There are still a few items where I am not sure yet:
See #1862 |
My change adds support for sending multiple commands to multiple devices at once. I wanted to control multiple windows covers from Home Assistant using Local API and found out that it was slower and was causing issues when I wanted to close all my covers at once (10 devices) for example.
I started working on a modification for the core Overkiz integration in Home Assistant to support this use case from scripts, but realized that I needed to add the support to the API Client first.
Sample usage: