1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-22 19:53:46 +01:00
This commit is contained in:
J. Nick Koston
2025-10-15 17:50:27 -10:00
parent d7832c44bc
commit 12874187dd

View File

@@ -60,7 +60,7 @@ class SlidingWindowFilter : public Filter {
protected: protected:
/// Called by new_value() to compute the filtered result from the current window /// Called by new_value() to compute the filtered result from the current window
virtual float compute_result_() = 0; virtual float compute_result() = 0;
/// Access the sliding window values (ring buffer implementation) /// Access the sliding window values (ring buffer implementation)
/// Use: for (size_t i = 0; i < window_count_; i++) { float val = window_[i]; } /// Use: for (size_t i = 0; i < window_count_; i++) { float val = window_[i]; }
@@ -131,7 +131,7 @@ class QuantileFilter : public SortedWindowFilter {
void set_quantile(float quantile) { this->quantile_ = quantile; } void set_quantile(float quantile) { this->quantile_ = quantile; }
protected: protected:
float compute_result_() override; float compute_result() override;
float quantile_; float quantile_;
}; };
@@ -152,7 +152,7 @@ class MedianFilter : public SortedWindowFilter {
using SortedWindowFilter::SortedWindowFilter; using SortedWindowFilter::SortedWindowFilter;
protected: protected:
float compute_result_() override; float compute_result() override;
}; };
/** Simple skip filter. /** Simple skip filter.
@@ -190,7 +190,7 @@ class MinFilter : public MinMaxFilter {
using MinMaxFilter::MinMaxFilter; using MinMaxFilter::MinMaxFilter;
protected: protected:
float compute_result_() override; float compute_result() override;
}; };
/** Simple max filter. /** Simple max filter.
@@ -210,7 +210,7 @@ class MaxFilter : public MinMaxFilter {
using MinMaxFilter::MinMaxFilter; using MinMaxFilter::MinMaxFilter;
protected: protected:
float compute_result_() override; float compute_result() override;
}; };
/** Simple sliding window moving average filter. /** Simple sliding window moving average filter.