Struct lifxi::http::Breathe

source ·
pub struct Breathe<'a, T: Select> { /* private fields */ }
Expand description

Specifies a “breathe” effect, wherein the light color fades smoothly to transition.

Example

use lifxi::http::prelude::*;
let secret = "foo";
let client = Client::new(secret);
let result = client
    .select(Selector::All)
    .breathe(Color::Green)
    .from(Color::Red)
    .period(::std::time::Duration::new(1, 0))
    .cycles(10)
    .persist(true)
    .power(true)
    .peak(0.5)
    .send();

Implementations

Sets the starting color.

If left blank, the current color of the bulb is used.

Example
use lifxi::http::prelude::*;
let secret = "foo";
let client = Client::new(secret);
let result = client
    .select(Selector::All)
    .breathe(Color::Green)
    .from(Color::Red)
    .send();

Sets the animation duration.

Example
use lifxi::http::prelude::*;
let secret = "foo";
let client = Client::new(secret);
let result = client
    .select(Selector::All)
    .breathe(Color::Green)
    .period(::std::time::Duration::new(3,0))
    .send();

Sets the number of cycles to execute.

Example
use lifxi::http::prelude::*;
let secret = "foo";
let client = Client::new(secret);
let result = client
    .select(Selector::All)
    .breathe(Color::Green)
    .cycles(7)
    .send();

Sets whether to keep the bulb at the stopping color after completion.

Example
use lifxi::http::prelude::*;
let secret = "foo";
let client = Client::new(secret);
let result = client
    .select(Selector::All)
    .breathe(Color::Green)
    .persist(true)
    .send();

Sets whether to power on the light if currently off.

Example
use lifxi::http::prelude::*;
let secret = "foo";
let client = Client::new(secret);
let result = client
    .select(Selector::All)
    .breathe(Color::Green)
    .power(true)
    .send();

Sets when the peak of the animation should be (0–1, proportion of period).

Example
use lifxi::http::prelude::*;
let secret = "foo";
let client = Client::new(secret);
let result = client
    .select(Selector::All)
    .breathe(Color::Green)
    .peak(0.3)
    .send();

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.