mirror of
https://github.com/esphome/esphome.git
synced 2026-08-22 22:26:21 +00:00
[sensor] Inline the trivial ExponentialMovingAverageFilter setters
This commit is contained in:
@@ -164,8 +164,6 @@ optional<float> ExponentialMovingAverageFilter::new_value(float value) {
|
|||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
void ExponentialMovingAverageFilter::set_send_every(uint16_t send_every) { this->send_every_ = send_every; }
|
|
||||||
void ExponentialMovingAverageFilter::set_alpha(float alpha) { this->alpha_ = alpha; }
|
|
||||||
|
|
||||||
// ThrottleAverageFilter
|
// ThrottleAverageFilter
|
||||||
ThrottleAverageFilter::ThrottleAverageFilter(uint32_t time_period) : time_period_(time_period) {}
|
ThrottleAverageFilter::ThrottleAverageFilter(uint32_t time_period) : time_period_(time_period) {}
|
||||||
|
|||||||
@@ -239,8 +239,8 @@ class ExponentialMovingAverageFilter : public Filter {
|
|||||||
|
|
||||||
optional<float> new_value(float value) override;
|
optional<float> new_value(float value) override;
|
||||||
|
|
||||||
void set_send_every(uint16_t send_every);
|
void set_send_every(uint16_t send_every) { this->send_every_ = send_every; }
|
||||||
void set_alpha(float alpha);
|
void set_alpha(float alpha) { this->alpha_ = alpha; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
float accumulator_{NAN};
|
float accumulator_{NAN};
|
||||||
|
|||||||
Reference in New Issue
Block a user