Skip to content

Commit

Permalink
timeout filter: return value (esphome#5612)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesserockz authored Oct 27, 2023
1 parent 535568e commit 0c5d5cd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions esphome/components/sensor/filter.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "filter.h"
#include <cmath>
#include "esphome/core/hal.h"
#include "esphome/core/log.h"
#include "sensor.h"
#include <cmath>

namespace esphome {
namespace sensor {
Expand Down Expand Up @@ -376,9 +376,7 @@ void OrFilter::initialize(Sensor *parent, Filter *next) {
// TimeoutFilter
optional<float> TimeoutFilter::new_value(float value) {
this->set_timeout("timeout", this->time_period_, [this]() { this->output(this->value_); });
this->output(value);

return {};
return value;
}

TimeoutFilter::TimeoutFilter(uint32_t time_period, float new_value) : time_period_(time_period), value_(new_value) {}
Expand Down

0 comments on commit 0c5d5cd

Please sign in to comment.