huesmith 0.1.0

Hue-compatible Zigbee light library for ESP32-C6/H2 (ESP-IDF)
//! CCT (colour-temperature) light — two PWM channels, cool-white and warm-white.
//!
//! Two supported wirings:
//!
//! Default (active-high, for real loads): each GPIO drives a low-side
//! N-MOSFET/transistor that carries the channel current.
//!   lamp+ → supply rail (e.g. 12/24 V)
//!   GPIO_COOL → cool MOSFET gate, drain → W−, source → GND
//!   GPIO_WARM → warm MOSFET gate, drain → Y−, source → GND
//!
//! Direct GPIO sink (tiny 3V lamps only, within the GPIO current limit) — the
//! negative wires are soldered straight to the GPIOs, which sink the current;
//! add `.inverted()` so the driver reverses the electrical duty:
//!   lamp+ → 3V3
//!   W−    → GPIO_COOL
//!   Y−    → GPIO_WARM
//!
//! Adjust the GPIO numbers to match your hardware.
//! `.mac()` is optional; omit it to let the ESP32 use its built-in MAC.
//! `.reset_pin()` enables factory reset: hold the pin low at boot to unpair.
//!
//! Reference code, not standalone firmware — see `examples/README.md`.

fn main() {
    const GPIO_COOL: u8 = 19;
    const GPIO_WARM: u8 = 18;

    huesmith::cct(GPIO_COOL, GPIO_WARM)
        // .inverted() // uncomment for the direct GPIO-sink wiring above
        .starts_on()
        .reset_pin(9) // BOOT button on most ESP32-C6 boards
        // .mac([0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00, 0x01])
        .launch();
}