Skip to content

Commit

Permalink
skip coils without hardware drivers when generating coil info for ser…
Browse files Browse the repository at this point in the history
…vice menu
  • Loading branch information
bosh committed Feb 14, 2025
1 parent f9c7cab commit d1dfa74
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
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

0 comments on commit d1dfa74

Please sign in to comment.