From 0c5d5cd6235e31e2386ac3000ff87f3131b8bcd0 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Fri, 27 Oct 2023 16:36:54 +1300 Subject: [PATCH] timeout filter: return value (#5612) --- esphome/components/sensor/filter.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/esphome/components/sensor/filter.cpp b/esphome/components/sensor/filter.cpp index d1cb8d1c4b..b5bef4930c 100644 --- a/esphome/components/sensor/filter.cpp +++ b/esphome/components/sensor/filter.cpp @@ -1,8 +1,8 @@ #include "filter.h" +#include #include "esphome/core/hal.h" #include "esphome/core/log.h" #include "sensor.h" -#include namespace esphome { namespace sensor { @@ -376,9 +376,7 @@ void OrFilter::initialize(Sensor *parent, Filter *next) { // TimeoutFilter optional 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) {}