Since Horus was said to be the sky, he was considered to also contain the sun and moon.
The API has only been tested with LIFX Mini White.
This project is a POC and does not have to be used in a production environment.
Horus is an API which handles your LIFX devices in your local network. It uses UDP packets to interact with them. It has been designed to simplify your interactions with your LIFX devices, without cloud connection.
- Go in
config.yaml
. - Follow the documentation.
- Install Docker and docker-compose
Optional
Edit the environment variables in thedocker-compose.yml
file.- Download and launch the container
$ docker-compose up -d
- Read the Swagger documentation.
- Use it!
# Get all of your LIFX devices
$ curl -iL -X GET 'localhost:2020/lights/'
# Toggle your lights
$ curl -iL -X POST -H "Content-Type:application/json" --data '{"duration":1500}' 'localhost:2020/lights/toggle?selector=all&key=086bf714-7d7f-4f1c-a195-ba2809827374'
# Toggle your light with the UUID `33d07008-2082-4d7f-82f3-04c275b70055`
$ curl -iL -X POST -H "Content-Type:application/json" --data '{"duration":1500}' 'localhost:2020/lights/toggle?selector=uuid:33d07008-2082-4d7f-82f3-04c275b70055&key=086bf714-7d7f-4f1c-a195-ba2809827374'
# Edit the color, the power status and the label your light called `foo`
$ curl -iL -X PUT -H "Content-type:application/json" --data '{
"hsbk": {
"hue": 65535,
"saturation": 65535,
"brightness": 10000,
"kelvin": 9000
},
"duration": 1500,
"power": "on",
"label": "bar"
}' 'localhost:2020/lights/state?selector=label:foo&key=086bf714-7d7f-4f1c-a195-ba2809827374'
You can find the documentation here.
You can also generate the Swagger (OpenAPI) documentation by running the application and going on:
http://localhost:2020/unsecured/openapi.json
# Or with curl
$ curl -X GET 'localhost:2020/unsecured/openapi.json'
- Add location and group routes (/lights/group & /lights/location
- Try with other devices such as Mini Color, Tile Kit, Plus
- Open to other brands