hues
A Rust client for the Philips Hue API v2, with a focus on accuracy to the official spec.
hues uses reqwest and the tokio async runtime. It currently supports most basic operations, such as:
- Local network device discovery
- Via mDNS using the mdns crate, requires the
mdnsfeature - Via HTTPS using the Hue Discovery Endpoint
- Via mDNS using the mdns crate, requires the
- App key creation
- Light, Group, and Scene control
- Schedule and Smart Scene management
It does not yet support the following features:
- Entertainment API for fast, synchronous light effects via UDP
- Advanced features regarding Entertainment Configurations
[!WARNING] This is an experimental library, and is subject to change. Use at your own risk.
Installation
Usage
If you already know your Bridge IP address and have previously created an App Key, constructing a client is quick and simple:
use *;
async
Bridge discovery and registration
When the Bridge IP address is not known, you can locate the device on the local network using the Bridge::discover associated function. If you are creating an app for the first time, the Bridge::create_app method initializes new credentials that can be used for future authentication.
use *
use Duration;
async
Automatic sync with sse
Optionally, you can sync automatically by listening for Server-Sent Events. The bridge will communicate changes as they happen to the client, and you can take action if you choose to do so:
use *;
async main
License
MIT © Tobias Fried