Merge remote-tracking branch 'upstream/master'

Updating Fork with Master
This commit is contained in:
Dan
2021-01-02 23:25:19 -05:00
4 changed files with 14 additions and 30 deletions

View File

@@ -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/

View File

@@ -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

View File

@@ -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
self.mode = mode

View File

@@ -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",