| Crates.io | huemanity |
| lib.rs | huemanity |
| version | 0.1.6 |
| created_at | 2019-12-16 21:07:23.76667+00 |
| updated_at | 2020-02-03 21:28:56.842819+00 |
| description | A simple wrapper and CLI for the Phillips Hue lights. Added registration, but you need to know the IP of the bridge. |
| homepage | https://finnkauski.com |
| repository | https://github.com/finnkauski/huemanity |
| max_upload_size | |
| id | 189851 |
| size | 149,527 |

A bare-bones package to control Phillips Hue lights written in Rust.
This CLI and crate is designed to serialise and deserialise lights from the
Philips Hue API and send state to the lights.
The CLI is a bit underdeveloped at the moment, however the general crate
works well. The central object (the Bridge) gets instantiated and is then able
to send state to each individual light.
NOTE: Currently the Bridge object needs you to know the ip that your Hue
Bridge is assigned on your network. Once that is known you are able to register
the application and send commands.
Installing the latest version:
git clone git@github.com:finnkauski/huemanity.git
cd huemanity
cargo install huemanity
Installing from crates.io (might be outdated):
cargo install huemanity
The simplest use case is passing a state to all lights.
# turn lights on
huemanity all --state "{\"on\":true}"
# change color
huemanity all --state "{\"xy\":[1.0, 0.0]}"
This follows closely (basically wraps) the interactions described in the hue API get-started post up to the point of sending state to the lights.
If you would like to contribute here are a few things that need PRs:
The Bridge.state_all sequentially to each light, this needs a bit more
concurrency so requests get sent in one go. The reqwest library might have
an async client so that might need to be implemented.
The CLI needs a much better wrapping and functionality
I do not like that the end user needs to know the bridge ip address. Ideally that would be automatically detected.
I stream the development of this on twitch.tv And it is currently used to create this project which links an electric drumkit to my HUE lights.