[][src]Struct huelib::resource::light::StateModifier

pub struct StateModifier {
    pub on: Option<bool>,
    pub brightness: Option<Adjust<u8>>,
    pub hue: Option<Adjust<u16>>,
    pub saturation: Option<Adjust<u8>>,
    pub color_space_coordinates: Option<Adjust<(f32, f32)>>,
    pub color_temperature: Option<Adjust<u16>>,
    pub alert: Option<Alert>,
    pub effect: Option<Effect>,
    pub transition_time: Option<u16>,
}

Modifier for the light state.

Fields

on: Option<bool>

Turns the light on or off.

brightness: Option<Adjust<u8>>

Sets the brightness of the light.

hue: Option<Adjust<u16>>

Sets the hue of a light.

saturation: Option<Adjust<u8>>

Sets the saturation of a light.

color_space_coordinates: Option<Adjust<(f32, f32)>>

Sets the color space coordinates of the light.

color_temperature: Option<Adjust<u16>>

Sets the color temperature of a light.

alert: Option<Alert>

Sets the alert effect of a light.

effect: Option<Effect>

Sets the dynamic effect of a light.

transition_time: Option<u16>

Sets the transition duration of state changes.

This is given as a multiple of 100ms.

Implementations

impl StateModifier[src]

pub fn with_on(self, value: bool) -> Self[src]

Sets the on field of this struct.

pub fn with_brightness(self, value: Adjust<u8>) -> Self[src]

Sets the brightness field of this struct.

pub fn with_hue(self, value: Adjust<u16>) -> Self[src]

Sets the hue field of this struct.

pub fn with_saturation(self, value: Adjust<u8>) -> Self[src]

Sets the saturation field of this struct.

pub fn with_color_space_coordinates(self, value: Adjust<(f32, f32)>) -> Self[src]

Sets the color_space_coordinates field of this struct.

pub fn with_color_temperature(self, value: Adjust<u16>) -> Self[src]

Sets the color_temperature field of this struct.

pub fn with_alert(self, value: Alert) -> Self[src]

Sets the alert field of this struct.

pub fn with_effect(self, value: Effect) -> Self[src]

Sets the effect field of this struct.

pub fn with_transition_time(self, value: u16) -> Self[src]

Sets the transition_time field of this struct.

impl StateModifier[src]

pub fn new() -> Self[src]

Creates a new StateModifier.

pub fn with_color(self, value: Color) -> Self[src]

Convenient method to set the color_space_coordinates and brightness fields.

Trait Implementations

impl Clone for StateModifier[src]

impl Debug for StateModifier[src]

impl Default for StateModifier[src]

impl Modifier for StateModifier[src]

type Id = String

The type of the identifier. Read more

impl PartialEq<StateModifier> for StateModifier[src]

impl Serialize for StateModifier[src]

impl StructuralPartialEq for StateModifier[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.