Update pygameControls/dualsense_controller.py
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from pygameControls.controlsbase import ControlsBase
|
||||
from enums import ConnectionType
|
||||
from pydualsense import *
|
||||
|
||||
BATTERY_STATE = {
|
||||
@@ -16,7 +17,7 @@ class DualSenseController(ControlsBase):
|
||||
self.device.init()
|
||||
self.name = self.device.device.get_product_string()
|
||||
self.guid = self.device.get_guid()
|
||||
self.connection_type = connection_type
|
||||
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)
|
||||
@@ -42,6 +43,7 @@ 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