sd-controls


Namesd-controls JSON
Version 0.0.15 PyPI version JSON
download
home_pagehttps://github.com/niklasr22/streamdeck-controls
SummaryA small and simple framework for streamdeck applications
upload_time2024-03-26 17:52:55
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT
keywords streamdeck
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Streamdeck controls

This project is a simple and small framework which simplifies developing and running custom apps for streamdeck devices.
It allows using streamdecks without the offical software so you can use it with any major OS.

## Currently supported Streamdecks

- Streamdeck Mk.2

## Installing

### Prerequisites

- [hidapi](https://github.com/libusb/hidapi)

Linux:

```bash
sudo apt install libhidapi-dev
````

MacOS:

```bash
brew install hidapi
```

### Installing sd-controls

```bash
pip install sd-controls
```

## Contributing

If you are interested in this project and have a streamdeck, please consider contributing to it.
Adding support for other Streamdecks is greatly appreciated but feel free to propose any other changes too!

## Using this software with Linux (Linux udev rules)

Create a `/etc/udev/rules.d/50-elgato.rules` file with the following content:

```rules
SUBSYSTEM=="input", GROUP="input", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0080", MODE:="666", GROUP="plugdev"
KERNEL=="hidraw*", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0080", MODE:="666", GROUP="plugdev"
```

## Example app

```python
from PIL import Image
from sd_controls.sdsystem import SDSystem, SDUserApp, Sprites


class HelloWorldApp(SDUserApp):
    _KEY_GREET = 1
    _KEY_ROTATE = 2

    def __init__(self) -> None:
        super().__init__("Settings")
        self._icon = SDUserApp.generate_labeled_img(Sprites.CLEAR, "Hello World")
        self._hello = SDUserApp.generate_labeled_img(Sprites.CLEAR, "Hello")
        self._world = SDUserApp.generate_labeled_img(Sprites.CLEAR, "World")
        self._rotate_key = Sprites.GOAT

    def get_icon(self) -> Image:
        return self._icon

    def init(self) -> None:
        self.set_key(self._KEY_GREET, self._hello)
        self.set_key(self._KEY_ROTATE, self._rotate_key)

    def keys_update(self, keys_before: list[bool], keys: list[bool]) -> None:
        if not keys[self._KEY_GREET] and keys_before[self._KEY_GREET]:
            self.set_key(self._KEY_GREET, self._world)
        if not keys[self._KEY_ROTATE] and keys_before[self._KEY_ROTATE]:
            self._rotate_key = self._rotate_key.rotate(90)
            self.set_key(self._KEY_ROTATE, self._rotate_key)
            

system = SDSystem()
system.register_app(HelloWorldApp())
system.start()
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/niklasr22/streamdeck-controls",
    "name": "sd-controls",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "streamdeck",
    "author": null,
    "author_email": "byrousset@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e8/fd/04b75f47f9646842ba1157917137552b2f98cdd5dadcafb97f54010580ff/sd_controls-0.0.15.tar.gz",
    "platform": null,
    "description": "# Streamdeck controls\n\nThis project is a simple and small framework which simplifies developing and running custom apps for streamdeck devices.\nIt allows using streamdecks without the offical software so you can use it with any major OS.\n\n## Currently supported Streamdecks\n\n- Streamdeck Mk.2\n\n## Installing\n\n### Prerequisites\n\n- [hidapi](https://github.com/libusb/hidapi)\n\nLinux:\n\n```bash\nsudo apt install libhidapi-dev\n````\n\nMacOS:\n\n```bash\nbrew install hidapi\n```\n\n### Installing sd-controls\n\n```bash\npip install sd-controls\n```\n\n## Contributing\n\nIf you are interested in this project and have a streamdeck, please consider contributing to it.\nAdding support for other Streamdecks is greatly appreciated but feel free to propose any other changes too!\n\n## Using this software with Linux (Linux udev rules)\n\nCreate a `/etc/udev/rules.d/50-elgato.rules` file with the following content:\n\n```rules\nSUBSYSTEM==\"input\", GROUP=\"input\", MODE=\"0666\"\nSUBSYSTEM==\"usb\", ATTRS{idVendor}==\"0fd9\", ATTRS{idProduct}==\"0080\", MODE:=\"666\", GROUP=\"plugdev\"\nKERNEL==\"hidraw*\", ATTRS{idVendor}==\"0fd9\", ATTRS{idProduct}==\"0080\", MODE:=\"666\", GROUP=\"plugdev\"\n```\n\n## Example app\n\n```python\nfrom PIL import Image\nfrom sd_controls.sdsystem import SDSystem, SDUserApp, Sprites\n\n\nclass HelloWorldApp(SDUserApp):\n    _KEY_GREET = 1\n    _KEY_ROTATE = 2\n\n    def __init__(self) -> None:\n        super().__init__(\"Settings\")\n        self._icon = SDUserApp.generate_labeled_img(Sprites.CLEAR, \"Hello World\")\n        self._hello = SDUserApp.generate_labeled_img(Sprites.CLEAR, \"Hello\")\n        self._world = SDUserApp.generate_labeled_img(Sprites.CLEAR, \"World\")\n        self._rotate_key = Sprites.GOAT\n\n    def get_icon(self) -> Image:\n        return self._icon\n\n    def init(self) -> None:\n        self.set_key(self._KEY_GREET, self._hello)\n        self.set_key(self._KEY_ROTATE, self._rotate_key)\n\n    def keys_update(self, keys_before: list[bool], keys: list[bool]) -> None:\n        if not keys[self._KEY_GREET] and keys_before[self._KEY_GREET]:\n            self.set_key(self._KEY_GREET, self._world)\n        if not keys[self._KEY_ROTATE] and keys_before[self._KEY_ROTATE]:\n            self._rotate_key = self._rotate_key.rotate(90)\n            self.set_key(self._KEY_ROTATE, self._rotate_key)\n            \n\nsystem = SDSystem()\nsystem.register_app(HelloWorldApp())\nsystem.start()\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A small and simple framework for streamdeck applications",
    "version": "0.0.15",
    "project_urls": {
        "Bug Tracker": "https://github.com/niklasr22/streamdeck-controls/issues",
        "Homepage": "https://github.com/niklasr22/streamdeck-controls"
    },
    "split_keywords": [
        "streamdeck"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "236a26594a4e7418ae44d84f2e26188c1bf6635bc7d6722afb4871ae53a26d35",
                "md5": "d273fba31af5afb26d04697bf9a6f67a",
                "sha256": "f18eab04b5bf8c06985d9e9953db4966621063fff2d0a1daf317290431daed8d"
            },
            "downloads": -1,
            "filename": "sd_controls-0.0.15-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d273fba31af5afb26d04697bf9a6f67a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 116272,
            "upload_time": "2024-03-26T17:52:53",
            "upload_time_iso_8601": "2024-03-26T17:52:53.045522Z",
            "url": "https://files.pythonhosted.org/packages/23/6a/26594a4e7418ae44d84f2e26188c1bf6635bc7d6722afb4871ae53a26d35/sd_controls-0.0.15-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e8fd04b75f47f9646842ba1157917137552b2f98cdd5dadcafb97f54010580ff",
                "md5": "03fc7daaaa915df5cc640000fc625c25",
                "sha256": "fde7b4fb1a0aa5c3412617a0dab0909d28988f8c533f94ad876ba5167fe523c5"
            },
            "downloads": -1,
            "filename": "sd_controls-0.0.15.tar.gz",
            "has_sig": false,
            "md5_digest": "03fc7daaaa915df5cc640000fc625c25",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 117104,
            "upload_time": "2024-03-26T17:52:55",
            "upload_time_iso_8601": "2024-03-26T17:52:55.156300Z",
            "url": "https://files.pythonhosted.org/packages/e8/fd/04b75f47f9646842ba1157917137552b2f98cdd5dadcafb97f54010580ff/sd_controls-0.0.15.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-26 17:52:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "niklasr22",
    "github_project": "streamdeck-controls",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "sd-controls"
}
        
Elapsed time: 0.20760s