GUID identification used to determine gamepad. /JL
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from pygameControls.controlsbase import ControlsBase
|
||||
from enums import ConnectionType
|
||||
from .enums import ConnectionType
|
||||
from pydualsense import *
|
||||
|
||||
BATTERY_STATE = {
|
||||
@@ -12,12 +12,11 @@ BATTERY_STATE = {
|
||||
}
|
||||
|
||||
class DualSenseController(ControlsBase):
|
||||
def __init__(self, joy, connection_type):
|
||||
def __init__(self, joy):
|
||||
self.device = pydualsense()
|
||||
self.device.init()
|
||||
self.name = self.device.device.get_product_string()
|
||||
self.guid = self.device.get_guid()
|
||||
self.connection_type = ConnectionType(connection_type.values())
|
||||
self.powerlevel = self.device.battery.Level
|
||||
self.batterystate = BATTERY_STATE[str(self.device.battery.State)]
|
||||
self.set_player_id(PlayerID.PLAYER_1)
|
||||
@@ -43,7 +42,6 @@ class DualSenseController(ControlsBase):
|
||||
print(f"{self.name} connected")
|
||||
print(f"Power level: {self.powerlevel}")
|
||||
print(f"Battery state: {self.batterystate}")
|
||||
print(f"Connection type: {connection_type.capitalize()}")
|
||||
|
||||
def close(self):
|
||||
self.device.close()
|
||||
|
Reference in New Issue
Block a user