/pyrokuserve

Sanic based web server to control your home roku device

Primary LanguagePythonMIT LicenseMIT

pyrokuserve

Sanic based web server to control your home roku device, based on the api: python-roku.

Setup

use pipenv to install dependencies:

pipenv install

then either

pipenv run pyrokuserve.py

or

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/<device_id>/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/<device_id>/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: firewalld/firewalld#25 and firewalld/firewalld#260