[][src]Struct philipshue_edj::hue::LightCommand

pub struct LightCommand {
    pub on: Option<bool>,
    pub bri: Option<u8>,
    pub hue: Option<u16>,
    pub sat: Option<u8>,
    pub xy: Option<(f32, f32)>,
    pub ct: Option<u16>,
    pub alert: Option<String>,
    pub effect: Option<String>,
    pub transitiontime: Option<u16>,
    pub bri_inc: Option<i16>,
    pub sat_inc: Option<i16>,
    pub hue_inc: Option<i16>,
    pub ct_inc: Option<i16>,
    pub xy_inc: Option<(i16, i16)>,
}

Struct for building a command that will be sent to the Hue bridge telling it what to do with a light

View the lights-api documention for more information

Fields

on: Option<bool>

Whether to turn the light off or on

bri: Option<u8>

Brightness of the colour of the light

hue: Option<u16>

The hue of the colour of the light

sat: Option<u8>

The saturation of the colour of the light

xy: Option<(f32, f32)>

The x and y coordinates of a colour in CIE space

ct: Option<u16>

The Mired Color temperature of the light. 2012 connected lights are capable of 153 (6500K) to 500 (2000K).

alert: Option<String>effect: Option<String>

The dynamic effect of the light. It can be either "none" or "colorloop"

If "colorloop", the light will cycle hues

transitiontime: Option<u16>

The duration of the transition from the light’s current state to the new state.

This is given as a multiple of 100ms and defaults to 4 (400ms). For example, setting transitiontime 10 will make the transition last 1 second.

bri_inc: Option<i16>

Has to be a value between -254 and 254. Increments or decrements the value of the brightness.

sat_inc: Option<i16>

Has to be a value between -254 and 254. Increments or decrements the value of the saturation.

hue_inc: Option<i16>

Has to be a value between -65534 and 65534. Increments or decrements the value of the hue.

ct_inc: Option<i16>

Has to be a value between -65534 and 65534. Increments or decrements the value of the colour temperature.

xy_inc: Option<(i16, i16)>

Increments or decrements the value of the xy.

Methods

impl LightCommand[src]

pub fn on(self) -> Self[src]

Returns a LightCommand that turns a light on

pub fn off(self) -> Self[src]

Returns a LightCommand that turns a light on

pub fn with_bri(self, b: u8) -> Self[src]

Sets the brightness to set the light to

pub fn with_hue(self, h: u16) -> Self[src]

Sets the hue to set the light to

pub fn with_sat(self, s: u8) -> Self[src]

Sets the saturation to set the light to

pub fn with_xy(self, xy: (f32, f32)) -> Self[src]

Sets the xy colour coordinates to set the light to

pub fn with_ct(self, c: u16) -> Self[src]

Sets the temperature to set the light to

pub fn with_alert(self, a: String) -> Self[src]

Sets the alert mode to set the light to

pub fn with_effect(self, a: String) -> Self[src]

Sets the effect mode to set the light to

pub fn with_transitiontime(self, t: u16) -> Self[src]

Sets the transition time in decaseconds

pub fn with_bri_inc(self, b: i16) -> Self[src]

Sets the brightness increment value

pub fn with_hue_inc(self, h: i16) -> Self[src]

Sets the hue increment value

pub fn with_sat_inc(self, s: i16) -> Self[src]

Sets the saturation increment value

pub fn with_ct_inc(self, ct: i16) -> Self[src]

Sets the saturation increment value

pub fn with_xy_inc(self, xy: (i16, i16)) -> Self[src]

Sets the x and y increment value

Trait Implementations

impl Default for LightCommand[src]

impl Clone for LightCommand[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for LightCommand[src]

impl Serialize for LightCommand[src]

impl<'de> Deserialize<'de> for LightCommand[src]

Auto Trait Implementations

Blanket Implementations

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

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

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.