Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 938 Bytes

README.md

File metadata and controls

21 lines (17 loc) · 938 Bytes

Examples

Each folder is a small standalone program with its own requirements.txt and README.

Folder Shows Needs
rest_quickstart REST, blocking: list hubs, shockers and shares openshock
async_control REST, asyncio: send a command, handle typed errors openshock
realtime_events SignalR user hub: print live events for your account openshock[realtime]
live_control Live control: stream intensity to a shocker openshock[realtime]

All of them read an API token from OPENSHOCK_API_TOKEN (create one at openshock.app under Settings > API Tokens) and, optionally, the API URL of a self-hosted instance from OPENSHOCK_API_URL.

cd examples/rest_quickstart
pip install -r requirements.txt
export OPENSHOCK_API_TOKEN=your-api-token
python main.py