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

skip coils without hardware drivers when generating coil info for service menu #1876

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions mpf/core/service_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from typing import List

from mpf.core.mpf_controller import MpfController
from mpf.devices.dual_wound_coil import DualWoundCoil

SwitchMap = namedtuple("SwitchMap", ["board", "switch"])
CoilMap = namedtuple("CoilMap", ["board", "coil"])
Expand Down Expand Up @@ -92,8 +93,10 @@ def get_coil_map(self, do_sort=True) -> List[CoilMap]:
"""Return a map of all coils in the machine."""
coil_map = []
for coil in self.machine.coils.values():
assert coil.hw_driver is not None
coil_map.append(CoilMap(coil.hw_driver.get_board_name(), coil))
if isinstance(coil, DualWoundCoil):
self.info_log("Coil mapping skipped dual-wound coil %s", coil.name)
else:
coil_map.append(CoilMap(coil.hw_driver.get_board_name(), coil))

# sort by board + driver number
if do_sort:
Expand Down
4 changes: 4 additions & 0 deletions mpf/tests/machine_files/service_mode/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ coils:
number: 10
label: Fourth coil

dual_wound_coils:
c_dualwound_1_2:
hold_coil: c_test
main_coil: c_test2

switches:
s_door_open:
Expand Down
Loading