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

Defined in:

placeos-driver/interface/presence_smoother.cr

Constructors

Instance Method Summary

Constructor Detail

def self.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) #

[View source]

Instance Method Detail

def changed : Bool #

Whether the smoothed state changed during this poll.


def clone #

[View source]
def confidence : Float64 #

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


def confidence_percent : Float64 #

Percentage equivalent of confidence, from 0.0 to 100.0.


def 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) #

[View source]
def observed_for : Time::Span #

Amount of history currently available.


def off_fraction : Float64 #

def on_fraction : Float64 #

Proportion of the evaluated period attributed to each raw state.


def raw_state : Bool #

Most recently observed raw sensor state.


def state : Bool #

Smoothed/latched output state.


def window_ready : Bool #

True once at least one complete smoothing window exists.