mode_tests (example config files)

Machine config examples

Here are some example machine-wide config files that show real-world examples of how these configs are used.

Note that there are multiple machine config examples here. They’re just included to show different options. You wouldn’t actually use more than one.

#config_version=5

modes:
  - broken_mode2
  - mode2
#config_version=5

modes:
  - mode_restart_on_next_ball
#config_version=5

modes:
  - mode_without_config
#config_version=5

modes:
  - mode1
  - mode2
  - mode3
  - mode4
#config_version=5

modes:
  - mode2
  - broken_mode

Mode config examples

Here are some example mode config files that go along with the machine-wide config above.

Note that there are multiple mode config examples here. You might not necessarily use more than one in your machine.

#config_version=5
mode:
  start_events: start_mode4
  use_wait_queue: True
  game_mode: False
#config_version=5

unrelated_section:
  invalid_key: crap
#config_version=5
mode:
  start_events: start_mode1
  stop_events: stop_mode1
  priority: 200
  start_priority: 1
  stop_on_ball_end: false
  game_mode: False

mode_settings:
  this: true

config:
  - test.yaml
#config_version=5
mode_settings:
  test: 123
#config_version=5
mode:
  start_events: start_mode_restart_on_next_ball
  restart_on_next_ball: True
#config_version=5

mode:
  stop_events: stop_mode2
  stop_priority: 2
  restart_on_next_ball: true
from mpf.core.mode import Mode


class Mode3(Mode):
    def mode_init(self):
        self.custom_code = True

    def mode_start(self, **kwargs):
        pass

    def mode_stop(self, **kwargs):
        pass
#config_version=5

mode:
  code: mode3.Mode3