- Fix mypy errors
This commit is contained in:
Florian Kaiser
2020-12-31 23:53:23 +01:00
parent 94cb09dbdd
commit 93b5e38e6e
2 changed files with 5 additions and 6 deletions

View File

@@ -57,9 +57,8 @@ class pydualsense:
return False return False
except OSError as e: except OSError as e:
print(e) print(e)
else:
# TODO: find something for other platforms. Maybe not even needed on linux return False
return False
def __find_device(self) -> hid.Device: def __find_device(self) -> hid.Device:
@@ -71,13 +70,13 @@ class pydualsense:
Exception: No device detected Exception: No device detected
Returns: Returns:
[type]: [description] hid.Device: returns opened controller device
""" """
# TODO: detect connection mode, bluetooth has a bigger write buffer # TODO: detect connection mode, bluetooth has a bigger write buffer
# TODO: implement multiple controllers working # TODO: implement multiple controllers working
if self._check_hide(): if self._check_hide():
raise Exception('HIDGuardian detected. Delete the controller from HIDGuardian and restart PC to connect to controller') raise Exception('HIDGuardian detected. Delete the controller from HIDGuardian and restart PC to connect to controller')
detected_device = None detected_device: hid.Device = None
devices = hid.enumerate(vid=0x054c) devices = hid.enumerate(vid=0x054c)
for device in devices: for device in devices:
if device['vendor_id'] == 0x054c and device['product_id'] == 0x0CE6: if device['vendor_id'] == 0x054c and device['product_id'] == 0x0CE6:

View File

@@ -6,7 +6,7 @@ with open("README.md", "r") as fh:
setup( setup(
name='pydualsense', name='pydualsense',
version='0.4.0', version='0.4.1',
description='use your DualSense (PS5) controller with python', description='use your DualSense (PS5) controller with python',
long_description=long_description, long_description=long_description,
long_description_content_type="text/markdown", long_description_content_type="text/markdown",