huesmith-core 0.1.0

Platform-agnostic core for Hue-compatible Zigbee lights: color math, ZCL light state machine, and scene parsing
Documentation
  • Coverage
  • 41.98%
    68 out of 162 items documented0 out of 49 items with examples
  • Size
  • Source code size: 113.11 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.43 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • canack/huesmith
    3 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • canack

huesmith-core

Platform-agnostic core for Philips Hue–compatible Zigbee lights.

This crate holds everything that does not depend on a specific MCU or HAL, so it builds and tests on any host (Linux, macOS):

  • Color math — CIE 1931 XY ↔ RGB, mireds/Kelvin ↔ RGB, HSV, CCT channel mixing.
  • LightState — a ZCL-accurate light state machine (on/off, level, color modes, smooth transitions, identify blink, scene snapshots).
  • LightOutput — the trait a hardware backend implements to drive real LEDs.
  • Scene parsing — defensive parsing/encoding of Zigbee scene extension fields.
  • Device identity — Hue device types and ready-made Philips model presets.

The hardware/Zigbee-stack side lives in the companion crate huesmith, which implements LightOutput on ESP32-C6/H2 via ESP-IDF.

use huesmith_core::color::xy_to_rgb;

// CIE XY (ZCL 0–65535 range) + brightness (0–254) → 8-bit RGB
let (r, g, b) = xy_to_rgb(20495, 21561, 254);

Testing

huesmith-core is pure Rust and runs on the host:

cargo test -p huesmith-core --target x86_64-unknown-linux-gnu   # Linux
cargo test -p huesmith-core --target aarch64-apple-darwin       # macOS

See the project repository for the full guide.

Trademark & affiliation

This is an independent interoperability project and is not affiliated with, authorized, or endorsed by Signify (Philips Hue). "Philips Hue" and "Signify" are trademarks of Signify Netherlands B.V.; the bundled Philips model presets exist only so a self-built device can interoperate with a Hue Bridge. For educational and hobby use.

License

MIT