1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
# Python: Roku (ECP) Client
Asynchronous Python client for Roku devices using the [External Control Protocol](https://developer.roku.com/docs/developer-program/debugging/external-control-api.md).
## About
This package allows you to monitor and control Roku devices.
## Installation
```bash
pip install rokuecp
```
## Usage
```python
import asyncio
from rokuecp import Roku
async def main():
"""Show example of connecting to your Roku device."""
async with Roku("192.168.1.100") as roku:
print(roku)
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
```
## Setting up development environment
This Python project is fully managed using the [Poetry](https://python-poetry.org) dependency
manager. But also relies on the use of NodeJS for certain checks during
development.
You need at least:
- Python 3.9+
- [Poetry](https://python-poetry.org/docs/#installation)
- NodeJS 20+ (including NPM)
To install all packages, including all development requirements:
```bash
npm install
poetry install
```
As this repository uses the [pre-commit](https://pre-commit.com/) framework, all changes
are linted and tested with each commit. You can run all checks and tests
manually, using the following command:
```bash
poetry run pre-commit run --all-files
```
To run just the Python tests:
```bash
poetry run pytest
```
|