struct

PlaceOS::Driver::Presence::Smoother::Snapshot

Inherits Struct < Value < Object

Constructors

new(state : Bool, changed : Bool, raw_state : Bool, confidence : Float64, confidence_percent : Float64, on_fraction : Float64, off_fraction : Float64, observed_for : Time::Span, window_ready : Bool)
Source

Instance methods

changed

Whether the smoothed state changed during this poll.

clone
Source
confidence

Confidence in the smoothed output state, from 0.0 to 1.0.

confidence_percent

Percentage equivalent of confidence, from 0.0 to 100.0.

copy_with(state _state = @state, changed _changed = @changed, raw_state _raw_state = @raw_state, confidence _confidence = @confidence, confidence_percent _confidence_percent = @confidence_percent, on_fraction _on_fraction = @on_fraction, off_fraction _off_fraction = @off_fraction, observed_for _observed_for = @observed_for, window_ready _window_ready = @window_ready)
Source
observed_for

Amount of history currently available.

off_fraction
on_fraction

Proportion of the evaluated period attributed to each raw state.

raw_state

Most recently observed raw sensor state.

state

Smoothed/latched output state.

window_ready

True once at least one complete smoothing window exists.