huesmith-core 0.1.0

Platform-agnostic core for Hue-compatible Zigbee lights: color math, ZCL light state machine, and scene parsing
Documentation
pub const DEFAULT_ON_OFF_TRANSITION_TENTHS: u16 = 4;
pub const DEFAULT_LEVEL_TRANSITION_TENTHS: u16 = 5;
pub const DEFAULT_COLOR_TRANSITION_TENTHS: u16 = 7;

/// Commands that can be received from the Hue Bridge or other ZCL controllers.
#[derive(Debug, Clone)]
#[non_exhaustive]
pub enum LightCommand {
    On,
    Off,
    Toggle,
    SetLevel {
        level: u8,
        transition_time: u16,
    },
    MoveToColor {
        /// `None` when only the peer coordinate arrived; `Some(0)` is valid (edge of CIE gamut).
        x: Option<u16>,
        /// `None` when only the peer coordinate arrived; `Some(0)` is valid (edge of CIE gamut).
        y: Option<u16>,
        transition_time: u16,
    },
    MoveToColorTemp {
        mireds: u16,
        transition_time: u16,
    },
    MoveToHueAndSaturation {
        /// `None` when only the peer attribute (saturation) was written; `Some(0)` = pure red.
        hue: Option<u8>,
        /// `None` when only the peer attribute (hue) was written; `Some(0)` = fully desaturated.
        saturation: Option<u8>,
        transition_time: u16,
    },
    EnhancedMoveToHueAndSaturation {
        enhanced_hue: u16,
        /// `None` when only enhanced hue was written; `Some(0)` = fully desaturated.
        saturation: Option<u8>,
        transition_time: u16,
    },
    Identify {
        duration: u16,
    },
    /// ZCL Identify cluster TriggerEffect command (0x40).
    /// effect_id: 0x00=Blink, 0x01=Breathe, 0x02=Okay, 0x0B=ChannelChange,
    ///            0xFE=FinishEffect (run to completion), 0xFF=StopEffect.
    TriggerEffect {
        effect_id: u8,
        variant: u8,
    },
    StopMoveStep,
}