mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 21:44:55 +01:00
parent
af35c9258e
commit
aebb6d2fcc
1 changed files with 1 additions and 1 deletions
|
@ -167,7 +167,7 @@ optional<float> FilterOutValueFilter::new_value(float value) {
|
||||||
return value;
|
return value;
|
||||||
} else {
|
} else {
|
||||||
int8_t accuracy = this->parent_->get_accuracy_decimals();
|
int8_t accuracy = this->parent_->get_accuracy_decimals();
|
||||||
float accuracy_mult = pow10f(-accuracy);
|
float accuracy_mult = pow10f(accuracy);
|
||||||
float rounded_filter_out = roundf(accuracy_mult * this->value_to_filter_out_);
|
float rounded_filter_out = roundf(accuracy_mult * this->value_to_filter_out_);
|
||||||
float rounded_value = roundf(accuracy_mult * value);
|
float rounded_value = roundf(accuracy_mult * value);
|
||||||
if (rounded_filter_out == rounded_value)
|
if (rounded_filter_out == rounded_value)
|
||||||
|
|
Loading…
Reference in a new issue