Skip to content

Commit 8dd8051

Browse files
committed
Handle attract mode missing carousel
1 parent a009988 commit 8dd8051

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

mpf/modes/attract/code/attract.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ def __init__(self, *args, **kwargs):
2121
self.start_hold_time = 0.0
2222
self.start_buttons_held = list()
2323

24+
def mode_init(self):
25+
"""Initialize the mode and handle missing carousel items."""
26+
try:
27+
super().mode_init()
28+
except AssertionError:
29+
pass
30+
2431
def mode_start(self, **kwargs):
2532
"""Start the attract mode."""
2633
# register switch handlers for the start button press so we can
@@ -49,7 +56,9 @@ def mode_start(self, **kwargs):
4956
playfield.ball_search.enable()
5057
playfield.ball_search.start()
5158

52-
super().mode_start(**kwargs)
59+
# Check for carousel items
60+
if self._all_items:
61+
super().mode_start(**kwargs)
5362

5463
def start_button_pressed(self):
5564
"""Handle start button press.

0 commit comments

Comments
 (0)