Skip to content
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

Actions are applied sequentialy #92

Closed
vlebourl opened this issue Jun 29, 2020 · 1 comment · Fixed by #93
Closed

Actions are applied sequentialy #92

vlebourl opened this issue Jun 29, 2020 · 1 comment · Fixed by #93
Labels
bug Something isn't working

Comments

@vlebourl
Copy link
Collaborator

Describe the bug
When triggering multiple actions in a short time period, actions are executed sequentially by the box instead of concurrently.

Expected behavior
Action should be able to execute at once on independent devices.

Additional context
This probably relates to the introduction of this part in apply_action:

        while exec_id in self.controller.get_current_executions():
            continue

This relates to #90 (2)

@vlebourl vlebourl added the bug Something isn't working label Jun 29, 2020
vlebourl added a commit that referenced this issue Jun 29, 2020
vlebourl added a commit that referenced this issue Jun 29, 2020
As an async apply_action doesn't prevent the lock, I propose to add
an execution queue to tahoma_device entities, and only perform the update
once the queue is empty.
Having `update` instead of `schedule_update` line 97 doesn't prevent the lock...

Related Github issues: #92
@vlebourl
Copy link
Collaborator Author

This has been tested with covers on my end, but would need further testing, and might not be the best solution...
I guess rewriting the API with event based updates would also render this outdated.
Maybe simply reverting the waiting in the apply_action is enough for now? I think it is useful that entities that take time to apply an action (like closing covers or gates, activating a particular mode on a heater) wait until the action is completed before being updated so that the UI reflects the actual state of the device, and doesn't have to wait for SCAN_INTERVAL before having an accurate state displayed.

vlebourl added a commit that referenced this issue Jun 29, 2020
Also clear the exec_queue if it's not executing anymore.

Related Github issues: #92
@vlebourl vlebourl linked a pull request Jun 29, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant