35 void input(
float value);
61 explicit QuantileFilter(
size_t window_size,
size_t send_every,
size_t send_first_at,
float quantile);
65 void set_send_every(
size_t send_every);
66 void set_window_size(
size_t window_size);
67 void set_quantile(
float quantile);
91 explicit MedianFilter(
size_t window_size,
size_t send_every,
size_t send_first_at);
95 void set_send_every(
size_t send_every);
96 void set_window_size(
size_t window_size);
137 explicit MinFilter(
size_t window_size,
size_t send_every,
size_t send_first_at);
141 void set_send_every(
size_t send_every);
142 void set_window_size(
size_t window_size);
165 explicit MaxFilter(
size_t window_size,
size_t send_every,
size_t send_first_at);
169 void set_send_every(
size_t send_every);
170 void set_window_size(
size_t window_size);
198 void set_send_every(
size_t send_every);
199 void set_window_size(
size_t window_size);
219 void set_send_every(
size_t send_every);
220 void set_alpha(
float alpha);
223 bool first_value_{
true};
224 float accumulator_{NAN};
238 void setup()
override;
242 float get_setup_priority()
const override;
248 bool have_nan_{
false};
313 uint32_t last_input_{0};
324 float get_setup_priority()
const override;
337 float get_setup_priority()
const override;
347 void setup()
override;
351 float get_setup_priority()
const override;
356 bool has_value_{
false};
361 explicit DeltaFilter(
float delta,
bool percentage_mode);
369 float last_value_{NAN};
374 explicit OrFilter(std::vector<Filter *> filters);
391 bool has_value_{
false};
398 : linear_functions_(
std::move(linear_functions)) {}
416 ClampFilter(
float min,
float max,
bool ignore_out_of_range);
lambda_filter_t lambda_filter_
uint32_t min_time_between_inputs_
std::deque< float > queue_
This class allows for creation of simple template filters.
std::vector< std::array< float, 3 > > linear_functions_
std::vector< Filter * > filters_
std::vector< float > coefficients_
bool ignore_out_of_range_
std::deque< float > queue_
virtual optional< float > new_value(float value)=0
This will be called every time the filter receives a new value.
float value_to_filter_out_
Simple exponential moving average filter.
CalibratePolynomialFilter(std::vector< float > coefficients)
A simple filter that only forwards the filter chain if it doesn't receive value_to_filter_out.
virtual void initialize(Sensor *parent, Filter *next)
Initialize this filter, please note this can be called more than once.
A simple filter that adds offset to each value it receives.
A simple filter that multiplies to each value it receives by multiplier.
std::deque< float > queue_
std::deque< float > queue_
std::function< optional< float >(float)> lambda_filter_t
Apply a filter to sensor values such as moving average.
Implementation of SPI Controller mode.
Simple throttle average filter.
Base-class for all sensors.
void set_value(float new_value)
Simple sliding window moving average filter.
esphome::sensor::Sensor * sensor
CalibrateLinearFilter(std::vector< std::array< float, 3 >> linear_functions)