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

pub struct StateModifier { /* fields omitted */ }

Modifier for a light.

Methods

impl StateModifier[src]

pub fn new() -> Self[src]

Creates a new state modifier.

pub fn is_empty(&self) -> bool[src]

Whether all attributes are None.

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

Turns the light on or off.

pub fn brightness(self, modifier_type: ModifierType, value: u8) -> Self[src]

Sets the brightness of the light.

pub fn hue(self, modifier_type: ModifierType, value: u16) -> Self[src]

Sets the hue of a light.

pub fn saturation(self, modifier_type: ModifierType, value: u8) -> Self[src]

Sets the saturation of a light.

pub fn color_space_coordinates(
    self,
    modifier_type: CoordinateModifierType,
    value: (f32, f32)
) -> Self
[src]

Sets the x and y coordinates in the color space to set the color of a light.

If the modifier type is Override, the values must be between 0 and 1. If the modifier type is not Override, the values must be between 0 and 0.5.

pub fn color_temperature(self, modifier_type: ModifierType, value: u16) -> Self[src]

Sets the color temperature of a light.

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

Sets the alert effect of a light.

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

Sets the dynamic effect of a light.

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

Sets the duration of the transition from the light's current state to the new state. This is given as a multiple of 100ms.

Trait Implementations

impl Clone for StateModifier[src]

impl Copy for StateModifier[src]

impl Debug for StateModifier[src]

impl Default for StateModifier[src]

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.