From 28605e002314ec51330fbd17b71ec97730fdff30 Mon Sep 17 00:00:00 2001 From: Florian Kaiser <37000563+flok@users.noreply.github.com> Date: Mon, 28 Jun 2021 23:00:22 +0200 Subject: [PATCH] Update with linux support over usb --- pydualsense/pydualsense.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pydualsense/pydualsense.py b/pydualsense/pydualsense.py index be10749..0a9107a 100644 --- a/pydualsense/pydualsense.py +++ b/pydualsense/pydualsense.py @@ -1,7 +1,9 @@ # needed for python > 3.8 import os, sys -if sys.platform.startswith('win32') and sys.version_info >= (3,8): +from sys import platform + +if platform.startswith('Windows') and sys.version_info >= (3,8): os.add_dll_directory(os.getcwd()) import hidapi @@ -28,7 +30,12 @@ class pydualsense: self.state = DSState() # controller states - self.conType = self.determineConnectionType() # determine USB or BT connection + if platform.startswith('Windows'): + self.conType = self.determineConnectionType() # determine USB or BT connection + else: + # set for usb manually + self.input_report_length = 64 + self.output_report_length = 64 # thread for receiving and sending