Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lingster/pyrokuserve

Sanic based web server to control your home roku device
https://github.com/lingster/pyrokuserve

Last synced: about 2 months ago
JSON representation

Sanic based web server to control your home roku device

Awesome Lists containing this project

README

        

# pyrokuserve
[Sanic](https://github.com/huge-success/sanic) based web server to control your home roku device, based on the api: [python-roku](https://github.com/jcarbaugh/python-roku).

## Setup
use pipenv to install dependencies:
```bash
pipenv install
```
then either
```bash
pipenv run pyrokuserve.py
```
or
```bash
pipenv shell
python pyrokuserve.py
```

This will startup the sanic web server on default port 8000.

you can then send rest requests like:

|URL|Description|
|---|-----------|
|http://localhost:8000/device/list/ | returns list of roku devices |
|http://localhost:8000/device//apps/list/ | specify the roku device(from the previous call) and this will return you list of available channels on that device|
|http://localhost:8000/device//commandlist/ | returns list of commands to run against the device |
|http://localhost:8000/device/1/command// | execute the command, eg home will send roku to the home page |

Swagger documentation is available here:
http://localhost:8000/swagger

There are some very simple pytests in here.

Notes:
Firewalld - if you are using firewalld, then you will need to open up traffic for incoming requests to port 1900 as well as outgoing requests. Following example services to be opened up:

upnp-client.xml

UPnP Client
Universal Plug and Play client for auto-configuration of network routers (use only in trusted zones).

upnp.xml

UPNP
Simple Service Discovery Protocol

See: https://github.com/firewalld/firewalld/issues/25
and
https://github.com/firewalld/firewalld/issues/260