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

AssertionError: Device <shot.my_first_shot> cannot be overloaded. #1720

Open
gbouthenot opened this issue Oct 16, 2023 · 0 comments
Open

AssertionError: Device <shot.my_first_shot> cannot be overloaded. #1720

gbouthenot opened this issue Oct 16, 2023 · 0 comments

Comments

@gbouthenot
Copy link

gbouthenot commented Oct 16, 2023

I am following the tutorial and at the 18th step (https://missionpinball.org/tutorial/18_shots/)

shots:
  my_first_shot:
    profile: mode2

Is supposed to override the mode for "my_first_shot" shot. But it triggers this Exception:

ERROR : Machine : Runtime Exception
Traceback (most recent call last):
  File "envs/mpf-056/lib/python3.9/site-packages/mpf/core/machine.py", line 797, in _run_loop
    raise self._exception['exception']
  File "lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "envs/mpf-056/lib/python3.9/site-packages/mpf/core/events.py", line 121, in _async_handler_done
    future.result()
  File "envs/mpf-056/lib/python3.9/site-packages/mpf/core/device_manager.py", line 90, in _load_device_modules
    await self.machine.mode_controller.load_mode_devices()
  File "envs/mpf-056/lib/python3.9/site-packages/mpf/core/mode_controller.py", line 86, in load_mode_devices
    await mode.load_mode_devices()
  File "envs/mpf-056/lib/python3.9/site-packages/mpf/core/mode.py", line 438, in load_mode_devices
    device.overload_config_in_mode(self, settings)
  File "envs/mpf-056/lib/python3.9/site-packages/mpf/core/mode_device.py", line 56, in overload_config_in_mode
    raise AssertionError("Device {} cannot be overloaded.".format(self))
AssertionError: Device <shot.my_first_shot> cannot be overloaded.

Please note, that actually, the tutorial actually define an other shos instead of overloading "my_first_shot":

shots:
  my_first_shot_mode2:
    switch: s_right_inlane
    profile: mode2

But a few line after, the supposed block is shown

shots:
  my_first_shot:
    profile: mode2

This is what is triggering the error. The tutorial in step 18 (in mpc-examples repository) use the "other shot", so I think this is a known problem. But the tutorial is wrong saying that (it does not work)

However, unlike the "my_first_shot" entry in the base mode config, in the mode2 config we did NOT redefine the switch: or show_tokens: entries. Instead, we just added the profile: setting and told it to use a profile called mode2.

mpf version 0.56.2
mpf-mc version 0.56.1

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

No branches or pull requests

1 participant