• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

missionpinball / mpf / 33144170079
81%

Build:
DEFAULT BRANCH: dev
Ran 28 Aug 2026 05:15AM UTC
Jobs 10
Files 281
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Aug 2026 05:14AM UTC coverage: 81.295% (+0.004%) from 81.291%
33144170079

push

github

web-flow
Reset combo switch state when its mode stops (#2079)

* Reset combo switch state when its mode stops

A ComboSwitch keeps three pieces of state: _switches_1_active,
_switches_2_active and _state. device_removed_from_mode removed the
switch handlers and killed the pending delays but left all three
untouched.

The switches can still be held when the mode stops. That is the normal
case for any combo whose own event ends the mode that owns it, for
example a "hold both buttons to cancel the game" combo defined in a game
mode: the event tears the mode down while the player is still pressing.
With the handlers already removed the release is never seen, so the
device stays latched at 'both' with both groups marked active for the
life of the process.

Every later attempt is then dropped twice over. _switch_1_went_active
and _switch_2_went_active both open with "if self._switches_N_active:
return", so neither group ever re-arms, and _switch_state opens with "if
state == self.state: return", so even a re-armed group could not re-post
events_when_both. The combo works exactly once per process.

Reset the three attributes on mode removal. An unloaded device observes
nothing, so holding no state is the only accurate option, and a reload
re-arms from the next real switch change.

The existing test_combo_switches_in_mode releases the switches before
stopping the mode, so it never reached this path. The new test stops the
mode with both switches still down.

* Update mpf/devices/combo_switch.py

Co-authored-by: Bosh <alex@lobasc.io>

* Address review: reset combo switch state on mode start too

Extract _reset_state() and call it on both mode start and stop, so a
mode-scoped combo always starts from scratch and switches held from
before the mode started do not count. Shorten the comments. Add tests
for a mode restarted while its switches are held.

6 of 6 new or added lines in 1 file covered. (100.0%)

25759 of 31686 relevant lines covered (81.29%)

7.95 hits per line

Jobs
ID Job ID Ran Files Coverage
1 3.14-ubuntu-latest - 33144170079.1 28 Aug 2026 05:18AM UTC 281
78.24
GitHub Action Run
2 3.11-ubuntu-latest - 33144170079.2 28 Aug 2026 05:18AM UTC 281
81.29
GitHub Action Run
3 3.10-ubuntu-latest - 33144170079.3 28 Aug 2026 05:18AM UTC 281
81.29
GitHub Action Run
4 3.11-macos-latest - 33144170079.4 28 Aug 2026 05:18AM UTC 281
81.29
GitHub Action Run
5 3.12-ubuntu-latest - 33144170079.5 28 Aug 2026 05:18AM UTC 281
78.27
GitHub Action Run
6 3.12-macos-latest - 33144170079.6 28 Aug 2026 05:18AM UTC 281
78.27
GitHub Action Run
7 3.10-macos-latest - 33144170079.7 28 Aug 2026 05:18AM UTC 281
81.29
GitHub Action Run
8 3.13-macos-latest - 33144170079.8 28 Aug 2026 05:18AM UTC 281
78.27
GitHub Action Run
9 3.13-ubuntu-latest - 33144170079.9 28 Aug 2026 05:18AM UTC 281
78.27
GitHub Action Run
10 3.14-macos-latest - 33144170079.10 28 Aug 2026 05:18AM UTC 281
78.24
GitHub Action Run
Source Files on build 33144170079
  • Tree
  • List 281
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • cc968716 on github
  • Prev Build on dev (#32120974229)
  • Next Build on dev (#33852119175)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc