-
Notifications
You must be signed in to change notification settings - Fork 140
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
Config player delay #1541
Config player delay #1541
Conversation
mpf/core/utility_functions.py
Outdated
@@ -242,7 +242,7 @@ def dict_merge(a, b, combine_lists=True) -> dict: | |||
elif k in result and isinstance(result[k], dict): | |||
result[k] = Util.dict_merge(result[k], v, combine_lists) | |||
elif k in result and isinstance(result[k], list): | |||
if isinstance(v, dict) and v[0] == dict(_overwrite=True): | |||
if isinstance(v, list) and v[0] == dict(_overwrite=True): |
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.
I don't remember what situation I was in that kept crashing on this error, but attempting to access v[0]
when v
is a dict... seems like just a typo. If I'm overlooking something here, please let me know!
I reverted my change to |
This PR adds a new settings option to all ConfigPlayer-based classes:
delay
.When provided, the
delay
option will schedule the play event to be posted some time in the future. The implementation does not currently support cancelling delayed events.Note: the delay is not automatic for all ConfigPlayers. Instead, a ConfigPlayer class may choose to call
self.check_delayed_play()
as part of its play handler, as is done here missionpinball/mpf-mc#409 for SoundPlayer. Other players may follow suit, as needed.This PR also has some minor bugfixes and tweaks:
color
setting to allow RGB flashers to flash in colorThis last one is an edge case, but one I've been fighting. When a shot changes state, it posts the name of the new state and the old state. If custom python code has changed the profile of the shot and the new profile doesn't have as many states, and the shot was previously in a state higher than the number in the new profile, the attempt to fetch the old name would throw an exception. This PR gracefully handles that exception and just posts "unknown" as the old state name.