pub struct PulseEffect {
pub color: Option<String>,
pub from_color: Option<String>,
pub period: Option<f64>,
pub cycles: Option<f64>,
pub persist: Option<bool>,
pub power_on: Option<bool>,
}
Expand description
Used to set the params when posting a PulseEffect event
Fields§
§color: Option<String>
The color to use for the breathe effect.
from_color: Option<String>
The color to start the effect from. If this parameter is omitted then the color the bulb is currently set to is used instead.
period: Option<f64>
The time in seconds for one cycle of the effect.
cycles: Option<f64>
The number of times to repeat the effect.
persist: Option<bool>
If false set the light back to its previous value when effect ends, if true leave the last effect color.
power_on: Option<bool>
If true, turn the bulb on if it is not already on.
Implementations§
Source§impl PulseEffect
impl PulseEffect
Sourcepub fn new() -> Self
pub fn new() -> Self
Returns a new PulseEffect object
§Examples
extern crate lifx_rs as lifx;
fn main() {
let key = "xxx".to_string();
let mut api_endpoints: Vec<String> = Vec::new();
api_endpoints.push(format!("https://api.lifx.com"));
api_endpoints.push(format!("http://localhost:8089"));
let config = lifx::LifxConfig{
access_token: key.clone(),
api_endpoints: api_endpoints
};
let mut pulse = lifx::PulseEffect::new();
pulse.color = Some(format!("red"));
pulse.from_color = Some(format!("green"));
pulse.period = Some(10);
pulse.persist = Some(true);
pulse.power_on = Some(true);
}
Trait Implementations§
Source§impl Clone for PulseEffect
impl Clone for PulseEffect
Source§fn clone(&self) -> PulseEffect
fn clone(&self) -> PulseEffect
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PulseEffect
impl Debug for PulseEffect
Source§impl Default for PulseEffect
impl Default for PulseEffect
Source§fn default() -> PulseEffect
fn default() -> PulseEffect
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PulseEffect
impl<'de> Deserialize<'de> for PulseEffect
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
Source§impl PartialEq for PulseEffect
impl PartialEq for PulseEffect
Source§impl Serialize for PulseEffect
impl Serialize for PulseEffect
impl StructuralPartialEq for PulseEffect
Auto Trait Implementations§
impl Freeze for PulseEffect
impl RefUnwindSafe for PulseEffect
impl Send for PulseEffect
impl Sync for PulseEffect
impl Unpin for PulseEffect
impl UnwindSafe for PulseEffect
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