-
Notifications
You must be signed in to change notification settings - Fork 149
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
score reels no longer activate chime on score reset. #1784
base: dev
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,7 @@ def chime(cls, chime, **kwargs): | |
del kwargs | ||
chime.pulse() | ||
|
||
def set_value(self, value): | ||
def set_value(self, value, quiet=False): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aligned with my previous comment, changing the argument from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello. Please could you help me ?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When you post an event, you can include kwargs like so:
And then in an event listener, you can make it conditional:
|
||
"""Reset the score reel group to display the value passed. | ||
|
||
This method will "jump" the score reel group to display the value | ||
|
@@ -109,8 +109,7 @@ def set_value(self, value): | |
for i, reel in enumerate(self.reels): | ||
if not reel: | ||
continue | ||
|
||
reel.set_destination_value(self.desired_value_list[i]) | ||
reel.set_destination_value(self.desired_value_list[i], quiet) | ||
|
||
async def wait_for_ready(self): | ||
"""Return a future which will be done when all reels reached their destination.""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice fix, but limited to your specific application. An alternative approach would be to post the event with an argument like
reset: true
to indicate whether the reel is resetting or not. This way there's still an event for people who want/need to know the advancement of the reel, and chimes can be made conditional on that argument to determine whether to chime or not.