Struct philipshue::hue::LightCommand
[−]
[src]
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 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>
The alert effect
effect: Option<String>
The dynamic effect of the light. It can be either "none" or "colorloop"
If "colorloop", the light will cycle hues
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]
fn on(self) -> Self
Returns a LightCommand
that turns a light on
fn off(self) -> Self
Returns a LightCommand
that turns a light on
fn with_bri(self, b: u8) -> Self
Sets the brightness to set the light to
fn with_hue(self, h: u16) -> Self
Sets the hue to set the light to
fn with_sat(self, s: u8) -> Self
Sets the saturation to set the light to
fn with_xy(self, xy: (f32, f32)) -> Self
Sets the xy colour coordinates to set the light to
fn with_ct(self, c: u16) -> Self
Sets the temperature to set the light to
fn with_alert(self, a: String) -> Self
Sets the alert mode to set the light to
fn with_effect(self, a: String) -> Self
Sets the effect mode to set the light to
fn with_bri_inc(self, b: i16) -> Self
Sets the brightness increment value
fn with_hue_inc(self, h: i16) -> Self
Sets the hue increment value
fn with_sat_inc(self, s: i16) -> Self
Sets the saturation increment value
fn with_ct_inc(self, ct: i16) -> Self
Sets the saturation increment value
fn with_xy_inc(self, xy: (i16, i16)) -> Self
Sets the x and y increment value
Trait Implementations
impl Debug for LightCommand
[src]
impl Default for LightCommand
[src]
fn default() -> LightCommand
Returns the "default value" for a type. Read more
impl Clone for LightCommand
[src]
fn clone(&self) -> LightCommand
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more