Struct lifxi::http::ChangeState

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

A scoped request to uniformly change the state for all selected bulbs.

Example

use lifxi::http::prelude::*;
let client = Client::new("foo");
let result = client
    .select(Selector::All)
    .change_state()
    .power(true)
    .hue(-10)
    .saturation(0.1)
    .brightness(0.4)
    .kelvin(100)
    .transition(::std::time::Duration::new(7, 0))
    .infrared(-0.1)
    .send();

Implementations

Sets target power state.

Example
use lifxi::http::prelude::*;
let client = Client::new("foo");
let result = client
    .select(Selector::All)
    .change_state()
    .power(true)
    .brightness(-0.3)
    .send();

Sets transition duration.

Example
use lifxi::http::prelude::*;
let client = Client::new("foo");
let result = client
    .select(Selector::All)
    .change_state()
    .power(true)
    .transition(::std::time::Duration::new(7, 0))
    .send();

Sets change in hue.

Example
use lifxi::http::prelude::*;
let client = Client::new("foo");
let result = client
    .select(Selector::All)
    .change_state()
    .power(true)
    .hue(-10)
    .send();

Sets change in saturation.

Example
use lifxi::http::prelude::*;
let client = Client::new("foo");
let result = client
    .select(Selector::All)
    .change_state()
    .power(true)
    .saturation(0.1)
    .send();

Sets change in brightness.

Example
use lifxi::http::prelude::*;
let client = Client::new("foo");
let result = client
    .select(Selector::All)
    .change_state()
    .brightness(-0.2)
    .send();

Sets change in color temperature.

Example
use lifxi::http::prelude::*;
let client = Client::new("foo");
let result = client
    .select(Selector::All)
    .change_state()
    .kelvin(-500)
    .send();

Sets change in infrared level.

Example
use lifxi::http::prelude::*;
let client = Client::new("foo");
let result = client
    .select(Selector::Label("Outside".to_string()))
    .change_state()
    .infrared(-0.1)
    .send();

Trait Implementations

The HTTP verb to be used.
A reference to the shared client (so we can reuse it).
The relative path (to the API root) of the appropriate endpoint.
The request body to be used, as configured by the user.
The number of attempts to be made.

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.