36 void input(
float value);
62 explicit QuantileFilter(
size_t window_size,
size_t send_every,
size_t send_first_at,
float quantile);
66 void set_send_every(
size_t send_every);
67 void set_window_size(
size_t window_size);
68 void set_quantile(
float quantile);
92 explicit MedianFilter(
size_t window_size,
size_t send_every,
size_t send_first_at);
96 void set_send_every(
size_t send_every);
97 void set_window_size(
size_t window_size);
138 explicit MinFilter(
size_t window_size,
size_t send_every,
size_t send_first_at);
142 void set_send_every(
size_t send_every);
143 void set_window_size(
size_t window_size);
166 explicit MaxFilter(
size_t window_size,
size_t send_every,
size_t send_first_at);
170 void set_send_every(
size_t send_every);
171 void set_window_size(
size_t window_size);
199 void set_send_every(
size_t send_every);
200 void set_window_size(
size_t window_size);
220 void set_send_every(
size_t send_every);
221 void set_alpha(
float alpha);
224 bool first_value_{
true};
225 float accumulator_{NAN};
239 void setup()
override;
243 float get_setup_priority()
const override;
249 bool have_nan_{
false};
313 uint32_t last_input_{0};
323 float get_setup_priority()
const override;
336 float get_setup_priority()
const override;
346 void setup()
override;
350 float get_setup_priority()
const override;
355 bool has_value_{
false};
360 explicit DeltaFilter(
float delta,
bool percentage_mode);
368 float last_value_{NAN};
373 explicit OrFilter(std::vector<Filter *> filters);
390 bool has_value_{
false};
397 : linear_functions_(
std::move(linear_functions)) {}
415 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.
TemplatableValue< float > value_
std::vector< TemplatableValue< float > > values_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.
TemplatableValue< float > offset_
TemplatableValue< float > multiplier_
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.
Simple sliding window moving average filter.
esphome::sensor::Sensor * sensor
CalibrateLinearFilter(std::vector< std::array< float, 3 >> linear_functions)