Fixed a bug to allow rumble values 255. /JL

This commit is contained in:
2025-04-20 22:47:18 +02:00
parent 4adc27aec5
commit 8cba42f903
4 changed files with 4 additions and 4 deletions

View File

@@ -9,7 +9,7 @@ from .xbox_series_x_controller import XboxSeriesXController
from .generic_controller import GenericController from .generic_controller import GenericController
from .logitech_dual_action_controller import LogitechDualActionController from .logitech_dual_action_controller import LogitechDualActionController
__version__ = "0.1.2" __version__ = "0.1.3"
CONTROLLERS = { CONTROLLERS = {
"DualSense Wireless Controller": DualSenseController, "DualSense Wireless Controller": DualSenseController,

View File

@@ -77,7 +77,7 @@ class DualSenseController(ControlsBase):
pass pass
def rumble(self, left, right): def rumble(self, left, right):
if not left in range(255) or not right in range(255): if not left in range(256) or not right in range(256):
raise ValueError("left and right values must be in the range 0 - 255") raise ValueError("left and right values must be in the range 0 - 255")
self.device.setLeftMotor(left) self.device.setLeftMotor(left)
self.device.setRightMotor(right) self.device.setRightMotor(right)

View File

@@ -69,7 +69,7 @@ class DualSenseEdgeController(ControlsBase):
pass pass
def rumble(self, left, right): def rumble(self, left, right):
if not left in range(255) or not right in range(255): if not left in range(256) or not right in range(256):
raise ValueError("left and right values must be in the range 0 - 255") raise ValueError("left and right values must be in the range 0 - 255")
self.device.setLeftMotor(left) self.device.setLeftMotor(left)
self.device.setRightMotor(right) self.device.setRightMotor(right)

View File

@@ -3,7 +3,7 @@ if __name__ == "__main__":
setup( setup(
name='pygameControls', name='pygameControls',
version='0.1.2', version='0.1.3',
packages=find_packages(), packages=find_packages(),
install_requires=[], install_requires=[],
author='Jan Lerking', author='Jan Lerking',