Skip to main content

LightCommand

Enum LightCommand 

Source
pub enum LightCommand {
Show 15 variants Alert(AlertEffectType), Color { x: f32, y: f32, }, ColorTemp(u16), ColorTempDelta { action: DeltaAction, mirek_delta: Option<u16>, }, Dim(f32), DimDelta { action: Option<DeltaAction>, brightness_delta: Option<f32>, }, Dynamics { duration: Option<usize>, speed: Option<f32>, }, Gradient { points: Vec<CIEColor>, mode: Option<GradientMode>, }, Effect(EffectType), Identify, Metadata { name: Option<String>, archetype: Option<ProductArchetype>, }, On(bool), PowerUp { preset: PowerupPresetType, on: Option<PowerupOnState>, dimming: Option<PowerupDimming>, color: Option<PowerupColor>, }, Signaling { signal: SignalType, duration: usize, colors: Option<SignalColor>, }, TimedEffect { effect: TimedEffectType, duration: Option<usize>, },
}
Expand description

Commands for a Light.

Variants§

§

Alert(AlertEffectType)

Sets the alert effect for this light.

§

Color

CIE XY gamut position

Fields

§x: f32

X position in color gamut (0, 1)

§y: f32

Y position in color gamut (0, 1)

§

ColorTemp(u16)

Color temperature in absolute mirek [153, 500] or null when the light color is not in the ct spectrum.

§

ColorTempDelta

Color temperature change in mirek.

Fields

§mirek_delta: Option<u16>

Mirek delta to current mirek [0, 347]. Clip at mirek_minimum and mirek_maximum of mirek_schema.

§

Dim(f32)

Brightness percentage (0.0-100.0]. value cannot be 0, writing 0 changes it to lowest possible brightness.

§

DimDelta

Brightness change to this light.

Fields

§brightness_delta: Option<f32>

Brightness percentage of full-scale increase delta to current dimlevel. Clip at Max-level or Min-level.

§

Dynamics

Modifies properties of trasitions and timed effects of this light.

Fields

§duration: Option<usize>

Duration of a light transition or timed effects in ms.

§speed: Option<f32>

Speed of dynamic palette or effect.

The speed is valid for the dynamic palette if the status is DynamicsStatus::DynamicPalette or for the corresponding effect listed in status. In case of status None, the speed is not valid.

§

Gradient

Basic feature containing gradient properties.

Fields

§points: Vec<CIEColor>

Collection of gradients points. For control of the gradient points through a PUT a minimum of 2 points need to be provided.

§

Effect(EffectType)

Basic feature containing effect properties.

§

Identify

Triggers a visual identification sequence, performing one breathe cycle.

§

Metadata

Fields

§

On(bool)

Power state of this light.

§

PowerUp

Configures the power-up behavior of this light.

Fields

§preset: PowerupPresetType

When setting the custom preset, other properties can be set. For all other presets, no other properties can be included.

§

Signaling

Feature containing signaling properties.

Fields

§signal: SignalType
§duration: usize

Duration in seconds.

Has a max of 65,534,000ms and a stepsize of 1000ms. Values in between steps will be rounded. Duration is ignored for SignalType::NoSignal.

§colors: Option<SignalColor>

List of colors (1 or 2) to apply to the signal (not supported by all signals).

§

TimedEffect

Basic feature containing timed effect properties.

Fields

§duration: Option<usize>

Duration is mandatory when timed effect is set, except for TimedEffectType::NoEffect. Resolution decreases for a larger duration. e.g Effects with duration smaller than a minute will be rounded to a resolution of 1s, while effects with duration larger than an hour will be rounded up to a resolution of 300,000ms. Duration has a max of 21,600,000ms.

Implementations§

Trait Implementations§

Source§

impl Debug for LightCommand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for LightCommand

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more