Skip to content

Correctly get the number of joystick devices#7434

Merged
mdcutone merged 1 commit intopsychopy:devfrom
rlaboiss:joystick-number-of-devices
Oct 20, 2025
Merged

Correctly get the number of joystick devices#7434
mdcutone merged 1 commit intopsychopy:devfrom
rlaboiss:joystick-number-of-devices

Conversation

@rlaboiss
Copy link
Copy Markdown
Contributor

@rlaboiss rlaboiss commented Oct 16, 2025

The method getNumJoysticks() of the class hardware.joystick has been removed from file psychopy/hardware/joystick/__init__.py in commit edca46d. However, the code in the file experiment/components/joystick/__init__.py (injection in the _lastrun.py file) has not been updated accordingly. This causes any experiment that includes the joystick component to fail, displaying the error message No joystick/gamepad device found. The commit in this PR seems to fix the problem.

It also resolves a similar issue in the experiment.components.joyButtons class.

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.66%. Comparing base (6347f7c) to head (3f641a6).
⚠️ Report is 10 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #7434   +/-   ##
=======================================
  Coverage   48.66%   48.66%           
=======================================
  Files         353      353           
  Lines       65121    65121           
=======================================
  Hits        31693    31693           
  Misses      33428    33428           
Components Coverage Δ
app ∅ <ø> (∅)
boilerplate ∅ <ø> (∅)
library ∅ <ø> (∅)
vm-safe library ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@TEParsons TEParsons requested a review from mdcutone October 20, 2025 10:53
@TEParsons
Copy link
Copy Markdown
Contributor

This seems good to me, we're using getAvailableDevices across various other devices so this seems consistent. Adding @mdcutone as a reviewer as he knows most about the Joystick class.

@mdcutone mdcutone merged commit 3961655 into psychopy:dev Oct 20, 2025
6 checks passed
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

Successfully merging this pull request may close these issues.

3 participants