huesmith 0.1.0

Hue-compatible Zigbee light library for ESP32-C6/H2 (ESP-IDF)
//! Custom hardware — implement `LightOutput` and hand it to `custom()` when the
//! built-in GPIO/LEDC/RMT backends don't fit (an I²C PWM chip, a relay board,
//! your own calibration or effects). The full pairing, scene, transition, and
//! identify machinery then drives your code.
//!
//! `set_brightness` is the ZCL level (0-254, never 255), `set_rgb` is linear
//! 0-255 per channel, `set_color_temp` is raw 153-500 mireds. For full raw state
//! (hue/saturation, enhanced hue, CIE x/y, plus the live `rendered_brightness`
//! that ramps during fades), override the optional `state_update(&LightSnapshot)`
//! hook — see its rustdoc for a runnable animation pattern.
//!
//! Reference code, not standalone firmware — see `examples/README.md`.

use huesmith::{HueDeviceType, LightOutput};

struct MyDriver;

impl LightOutput for MyDriver {
    fn set_on(&mut self, on: bool) {
        log::info!("on = {on}"); // drive your hardware here
    }

    fn set_brightness(&mut self, level: u8) {
        log::info!("level = {level}"); // ZCL level, 0-254
    }

    fn set_rgb(&mut self, r: u8, g: u8, b: u8) {
        log::info!("rgb = {r},{g},{b}"); // colors render through this
    }
}

fn main() {
    huesmith::custom(HueDeviceType::DimmableLight, MyDriver).launch();
}