pub enum Method {
Show 15 variants
GetProp(Property),
GetProps(Vec<Property>),
Toggle,
SetPower(bool, Option<Effect>, Option<i32>),
SetRgb(i32, Option<Effect>, Option<i32>),
SetHsv(i32, i32, Option<Effect>, Option<i32>),
SetBright(i32, Option<Effect>, Option<i32>),
SetDefault,
BgSetRgb(i32, Option<Effect>, Option<i32>),
BgSetHsv(i32, i32, Option<Effect>, Option<i32>),
BgSetDefault,
BgSetPower(bool, Option<Effect>, Option<i32>),
BgSetBright(i32, Option<Effect>, Option<i32>),
SetCtAbx(i32, Option<Effect>, Option<i32>),
BgSetCtAbx(i32, Option<Effect>, Option<i32>),
}Expand description
Methods to be called on a device.
Variants§
GetProp(Property)
Get the specified property value.
GetProps(Vec<Property>)
Gets multiple property values.
Toggle
Toggle the power state of the device.
SetPower(bool, Option<Effect>, Option<i32>)
Set the power state of the device.
SetRgb(i32, Option<Effect>, Option<i32>)
Set the RGB Color of the light.
SetHsv(i32, i32, Option<Effect>, Option<i32>)
Set the HSV Color of the light.
§Arguments
hue- The hue of the color. It should be expressed in decimal integer ranges from 0 to 359.sat- The saturation of the color. It’s range is 0 to 100.
SetBright(i32, Option<Effect>, Option<i32>)
Set the brightness of the light.
§Arguments
bright- The brightness of the light. It’s range is 1 to 100. The brightness is a percentage instead of a absolute value. 100 means maximum brightness while 1 means the minimum brightness.
SetDefault
This method is used to save current state of smart LED in persistent memory. So if user powers off and then powers on the smart LED again (hard power reset), the smart LED will show last saved state.
BgSetRgb(i32, Option<Effect>, Option<i32>)
BgSetHsv(i32, i32, Option<Effect>, Option<i32>)
BgSetDefault
Saves current Background state; see Method::SetDefault for more info.
BgSetPower(bool, Option<Effect>, Option<i32>)
BgSetBright(i32, Option<Effect>, Option<i32>)
SetCtAbx(i32, Option<Effect>, Option<i32>)
Set color temperature of the light.
§Arguments
ct_valueis the target color temperature. The type is integer and range is 1700 ~ 6500 (k).
BgSetCtAbx(i32, Option<Effect>, Option<i32>)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Method
impl<'de> Deserialize<'de> for Method
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Method
impl StructuralPartialEq for Method
Auto Trait Implementations§
impl Freeze for Method
impl RefUnwindSafe for Method
impl Send for Method
impl Sync for Method
impl Unpin for Method
impl UnwindSafe for Method
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