diff --git a/.github/workflows/python-mypy.yml b/.github/workflows/python-mypy.yml deleted file mode 100644 index c5f0f7f..0000000 --- a/.github/workflows/python-mypy.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Mypy - -on: [push] - -jobs: - build: - runs-on: ubuntu-latest - name: Mypy - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install Dependencies - run: | - python -m pip install --upgrade pip - pip install mypy - - name: mypy - run: | - mypy pydualsense/ \ No newline at end of file diff --git a/README.md b/README.md index 13c9066..f1c8b67 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # pydualsense -control your dualsense through python. using the hid library this module implements the sending report for controlling you new PS5 controller. It creates a background thread to constantly receive and update the controller. +control your dualsense through python. using the hid library this package implements the report features for controlling your new PS5 controller. # install -Just install the package from [pypi](https://pypi.org/project/pydualsense/) +Download [hidapi](https://github.com/libusb/hidapi/releases) and place the x64 .dll file into your Workspace. After that install the package from [pypi](https://pypi.org/project/pydualsense/). ```bash pip install pydualsense @@ -12,7 +12,7 @@ pip install pydualsense ```python -from pydualsense import pydualsense +from pydualsense import pydualsense, TriggerModes ds = pydualsense() # open controller ds.init() # initialize controller @@ -22,7 +22,7 @@ ds.triggerL.setForce(1, 255) ds.close() # closing the controller ``` -See ``examples`` folder for some more ideas +See [examples](https://github.com/flok/pydualsense/tree/master/examples) folder for some more ideas # Help wanted diff --git a/pydualsense/pydualsense.py b/pydualsense/pydualsense.py index f9a50f1..8629fe3 100644 --- a/pydualsense/pydualsense.py +++ b/pydualsense/pydualsense.py @@ -1,9 +1,14 @@ -from os import device_encoding + +# needed for python > 3.8 +import os, sys +if sys.version_info >= (3,8): + os.add_dll_directory(os.getcwd()) + import hid # type: ignore -from .enums import (LedOptions, PlayerID, - PulseOptions, TriggerModes, Brightness) +from .enums import (LedOptions, PlayerID, PulseOptions, TriggerModes, Brightness) # type: ignore import threading import sys +import winreg class pydualsense: def __init__(self, verbose: bool = False) -> None:# @@ -519,4 +524,4 @@ class DSTrigger: if not isinstance(mode, TriggerModes): raise TypeError('Trigger mode parameter needs to be of type `TriggerModes`') - self.mode = mode \ No newline at end of file + self.mode = mode diff --git a/setup.py b/setup.py index 7dedb77..c4c8b28 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ with open("README.md", "r") as fh: setup( name='pydualsense', - version='0.4.1', + version='0.4.2', description='use your DualSense (PS5) controller with python', long_description=long_description, long_description_content_type="text/markdown",