pub struct LightState {
pub on: bool,
pub brightness: u8,
pub color_mode: ColorMode,
pub hue: u8,
pub saturation: u8,
pub color_x: u16,
pub color_y: u16,
pub color_temp_mireds: u16,
/* private fields */
}Expand description
Complete light state machine.
Fields§
§on: bool§brightness: u8§color_mode: ColorMode§hue: u8§saturation: u8§color_x: u16§color_y: u16§color_temp_mireds: u16Implementations§
Source§impl LightState
impl LightState
pub fn new(output: Box<dyn LightOutput>) -> Self
Sourcepub fn new_powered_on(output: Box<dyn LightOutput>) -> Self
pub fn new_powered_on(output: Box<dyn LightOutput>) -> Self
Create a state machine that starts physically on.
Sourcepub fn light_snapshot(&self) -> LightSnapshot
pub fn light_snapshot(&self) -> LightSnapshot
The complete raw state, as delivered to LightOutput::state_update.
Sourcepub fn scene_snapshot(&self) -> SceneState
pub fn scene_snapshot(&self) -> SceneState
Capture all light attributes that this firmware supports in Zigbee scenes.
pub fn apply_scene_state(&mut self, scene: &SceneState)
pub fn apply_scene_state_with_transition( &mut self, scene: &SceneState, transition_time_tenths: u16, )
pub fn apply_command(&mut self, cmd: &LightCommand)
pub fn start_transition( &mut self, brightness: Option<u8>, color_x: Option<u16>, color_y: Option<u16>, color_temp: Option<u16>, hue: Option<u8>, saturation: Option<u8>, transition_time_tenths: u16, )
pub fn transition_step_interval_ms(&self) -> u16
pub fn transition_active(&self) -> bool
pub fn identify_active(&self) -> bool
Sourcepub fn step_identify(&mut self) -> bool
pub fn step_identify(&mut self) -> bool
Advance one identify blink half-cycle (~500 ms). Returns true if more blinks remain and the caller should schedule another 500 ms alarm.
pub fn step_transition(&mut self) -> bool
Auto Trait Implementations§
impl !RefUnwindSafe for LightState
impl !Sync for LightState
impl !UnwindSafe for LightState
impl Freeze for LightState
impl Send for LightState
impl Unpin for LightState
impl UnsafeUnpin for LightState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more