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

Restrict/allow concurrent '...all' actions #743

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

Conversation

sgraystar
Copy link

Concurrent clipall/sayall can leave the system in an undefined state if the second action is processed while the system is in a partially grouped state. An example is clipall/sayall being used with a doorbell and someone pressing the doorbell button twice.

This feature implements a check within all-player-announcements. Calls to the helper will start a timer and, if restricted, subsequent calls will be ignored while the timer is active.
This allows time for the original state to be restored before the next clipall/sayall action.

Global variables are possibly not the best implementation, but none of the existing helper files require settings.js so this change did not introduce a require settings.js to all-player-announcements.

The auto changes look larger than actual changes to all-player-announcements, in summary:
if NOT (restricted AND current active announcement) {
start timer and use timer handle to track an active announcement
existing code
}
function (timer expiry) {
null the timer handle
}

Concurrent clipall/sayall can leave the system in an undefined grouped state.
This feature implements a check within all-player-announcements. Calls to the helper will start a timer and, if restricted, subsequent calls will be ignored while the timer is active.
This allows time for the original state to be restored before the next clipall/sayall action.

Global variables are possibly not the best implementation, but none of the existing helper files require settings.js so this change did not introduce a require to all-player-announcements.
@sgraystar sgraystar requested a review from jishi February 5, 2020 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant