Struct State

Source
pub struct State {
Show 17 fields pub on: Option<bool>, pub bri: Option<u8>, pub transition: Option<u8>, pub tt: Option<u8>, pub ps: Option<i32>, pub psave: Option<u8>, pub pl: Option<i8>, pub nl: Option<Nl>, pub udpn: Option<Udpn>, pub v: Option<bool>, pub rb: Option<bool>, pub live: Option<bool>, pub lor: Option<u8>, pub time: Option<u32>, pub mainseg: Option<u8>, pub playlist: Option<Playlist>, pub seg: Option<Vec<Seg>>,
}

Fields§

§on: Option<bool>

On/Off state of the light

§bri: Option<u8>

Brightness of the light. If on is false, contains last brightness when light was on (aka brightness when on is set to true. Setting bri to 0 is supported but it is recommended to use the range 1-255 and use on: false to turn off. The state response will never have the value 0 for bri.

§transition: Option<u8>

Duration of the crossfade between different colors/brightness levels. One unit is 100ms, so a value of 4 results in a transition of 400ms.

§tt: Option<u8>

Similar to transition, but applies to just the current API call. Not included in state response.

§ps: Option<i32>

-1 to 65535; ID of currently set preset. 1~17~ can be used to iterate through presets 1-17.

§psave: Option<u8>

1 to 16 (250 in 0.11); Save current light config to specified preset slot. Not included in state response.

§pl: Option<i8>

-1 to 0; ID of currently set playlist. For now, this sets the preset cycle feature, -1 is off and 0 is on.

§nl: Option<Nl>

Night light

§udpn: Option<Udpn>

UDP sync

§v: Option<bool>

If set to true in a JSON POST command, the response will contain the full JSON state object. Not included in state response

§rb: Option<bool>

If set to true, device will reboot immediately. Not included in state response.

§live: Option<bool>

If set to true, enters realtime mode and blanks the LEDs. The realtime timeout option does not have an effect when this command is used, WLED will stay in realtime mode until the state (color/effect/segments, excluding brightness) is changed. It is expected that {“live”:false} is sent once live data sending is terminated. Not included in state response.

§lor: Option<u8>

0, 1, or 2; Live data override. 0 is off, 1 is override until live data ends, 2 is override until ESP reboot (available since 0.10.0)

§time: Option<u32>

Set module time to unix timestamp. Not included in state response.

§mainseg: Option<u8>

0 to info.leds.maxseg-1; Main Segment

§playlist: Option<Playlist>

Custom preset playlists. Not included in state response (available since 0.11.0)

§seg: Option<Vec<Seg>>

Array of segment objects; Segments are individual parts of the LED strip. In 0.9.0 this will enables running different effects on differentparts of the strip.

Trait Implementations§

Source§

impl Clone for State

Source§

fn clone(&self) -> State

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for State

Source§

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

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

impl Default for State

Source§

fn default() -> State

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for State

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for State

Source§

fn eq(&self, other: &State) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for State

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
Source§

impl TryFrom<&str> for State

Source§

type Error = WledJsonApiError

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

fn try_from(str_in: &str) -> Result<State, WledJsonApiError>

Performs the conversion.
Source§

impl TryInto<String> for &State

Source§

type Error = WledJsonApiError

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

fn try_into(self) -> Result<String, WledJsonApiError>

Performs the conversion.
Source§

impl StructuralPartialEq for State

Auto Trait Implementations§

§

impl Freeze for State

§

impl RefUnwindSafe for State

§

impl Send for State

§

impl Sync for State

§

impl Unpin for State

§

impl UnwindSafe for State

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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
Source§

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,