Skip to content

This is an API for controlling a unicorn-phat as a lamp

avlan/unicorn-lamp-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple lamp API

⚠️ You should have unicornhat already installed to properly use this. Otherwise this API won't work

Just an API for turning a unicorn hat on and off. Default color is white and default brightness is 1

Installing dependencies

sudo pip3 install -r requirements.txt

Running

Locally

sudo venv/bin/uvicorn main:app --host=0.0.0.0

As a demon

sudo gunicorn -b 0.0.0.0:8000 -w 3 -k uvicorn.workers.UvicornH11Worker main:app --daemon

With systemd

Move content of unicorn-lamp-api.service file to /etc/systemd/system/unicorn-lamp-api.service

sudo systemctl start unicorn-lamp-api
sudo systemctl enable unicorn-lamp-api

TODO: Add authentication TODO: Research about supervisord

About

This is an API for controlling a unicorn-phat as a lamp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages