pub struct DeviceState {
pub power: bool,
pub online: Option<bool>,
pub brightness: Option<i32>,
pub color: Option<Color>,
pub color_temperature_kelvin: Option<i32>,
pub light_scene: Option<i64>,
pub diy_scene: Option<i64>,
pub has_segments: bool,
}Expand description
Parsed device state information (user-friendly)
Fields§
§power: boolPower on/off
online: Option<bool>Whether the device is reachable over wifi (if reported)
brightness: Option<i32>Brightness (0-100)
color: Option<Color>RGB color
color_temperature_kelvin: Option<i32>Color temperature in Kelvin
light_scene: Option<i64>Active dynamic light scene id (if the device reports one)
diy_scene: Option<i64>Active DIY scene id (if the device reports one)
has_segments: boolWhether the device reports segmented color control in its state
Implementations§
Source§impl DeviceState
impl DeviceState
Sourcepub fn from_capabilities(capabilities: Vec<CapabilityState>) -> Self
pub fn from_capabilities(capabilities: Vec<CapabilityState>) -> Self
Parse from raw capabilities array
Trait Implementations§
Source§impl Clone for DeviceState
impl Clone for DeviceState
Source§fn clone(&self) -> DeviceState
fn clone(&self) -> DeviceState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DeviceState
impl RefUnwindSafe for DeviceState
impl Send for DeviceState
impl Sync for DeviceState
impl Unpin for DeviceState
impl UnsafeUnpin for DeviceState
impl UnwindSafe for DeviceState
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