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

fix: cannot update multiple stations #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EdLeckert
Copy link
Collaborator

@EdLeckert EdLeckert commented Oct 12, 2024

If multiple station enable or disable actions are submitted quickly, as in a single Home Assistant Action with multiple targets, a refresh of the station's state is not requested from the controller until all of the update actions are completed. This results in actions after the first one using outdated information, the result being that earlier actions are overwritten. Only the last update "sticks".

By immediately updating the self._controller._state["stations"][bit_property] as bits are changed, this can be avoided. If for some reason the controller cannot perform any of the updates, this will be quickly indicated when state is returned from the controller after the updates are complete.

I only have a single controller with eight zones, so am unable to test the multiple "bank" case, but it should work.

This resolves vinteo/hass-opensprinkler#317.

Copy link

sonarcloud bot commented Oct 12, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple stations cannot be enabled/disabled with switch.turn_on or off
2 participants