From 125788eac2998a8fb89ac9533b8ee5b7ac2516f9 Mon Sep 17 00:00:00 2001 From: Jade Date: Wed, 10 Jul 2024 08:24:55 +0800 Subject: [PATCH] Add setRumble and isConnected to CommandGenericHID (#68) --- commands2/button/commandgenerichid.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/commands2/button/commandgenerichid.py b/commands2/button/commandgenerichid.py index 79b4128..74e8a91 100644 --- a/commands2/button/commandgenerichid.py +++ b/commands2/button/commandgenerichid.py @@ -186,3 +186,21 @@ def getRawAxis(self, axis: int) -> float: :returns: The value of the axis. """ return self._hid.getRawAxis(axis) + + def setRumble(self, type: GenericHID.RumbleType, value: float): + """ + Set the rumble output for the HID. + The DS currently supports 2 rumble values, left rumble and right rumble. + + :param type: Which rumble value to set. + :param value: The normalized value (0 to 1) to set the rumble to. + """ + self._hid.setRumble(type, value) + + def isConnected(self): + """ + Get if the HID is connected. + + :returns: True if the HID is connected. + """ + return self._hid.isConnected()