pub struct LightStatus {
pub kind: String,
pub id: u8,
pub output: bool,
pub brightness: Option<f64>,
pub rgb: Option<[u8; 3]>,
pub white: Option<u8>,
pub ct: Option<f64>,
}Expand description
Current state of one light component, for shelly light status.
brightness and ct are kept as f64 to round-trip whatever numeric form
the device reports without truncation; they are only displayed, never used in
further arithmetic.
Fields§
§kind: String§id: u8§output: bool§brightness: Option<f64>§rgb: Option<[u8; 3]>§white: Option<u8>§ct: Option<f64>Implementations§
Source§impl LightStatus
impl LightStatus
Sourcepub fn from_component_json(kind: LightKind, id: u8, v: &Value) -> LightStatus
pub fn from_component_json(kind: LightKind, id: u8, v: &Value) -> LightStatus
Parse from a single component status object (the value of e.g. “rgb:0”
in Shelly.GetStatus, or the body of <Kind>.GetStatus).
Trait Implementations§
Source§impl Clone for LightStatus
impl Clone for LightStatus
Source§fn clone(&self) -> LightStatus
fn clone(&self) -> LightStatus
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 moreSource§impl Debug for LightStatus
impl Debug for LightStatus
Source§impl PartialEq for LightStatus
impl PartialEq for LightStatus
Source§impl Serialize for LightStatus
impl Serialize for LightStatus
impl StructuralPartialEq for LightStatus
Auto Trait Implementations§
impl Freeze for LightStatus
impl RefUnwindSafe for LightStatus
impl Send for LightStatus
impl Sync for LightStatus
impl Unpin for LightStatus
impl UnsafeUnpin for LightStatus
impl UnwindSafe for LightStatus
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