huemanity

Crates.iohuemanity
lib.rshuemanity
version0.1.6
sourcesrc
created_at2019-12-16 21:07:23.76667
updated_at2020-02-03 21:28:56.842819
descriptionA simple wrapper and CLI for the Phillips Hue lights. Added registration, but you need to know the IP of the bridge.
homepagehttps://finnkauski.com
repositoryhttps://github.com/finnkauski/huemanity
max_upload_size
id189851
size149,527
Art (finnkauski)

documentation

https://docs.rs/huemanity/

README

Huemanity

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.

Usage

Install

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

Usage

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]}"

For more info:

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.

Contributing

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.

Watch this development

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.

Commit count: 0

cargo fmt