From cf98c497d5618384e771742e794becae0fd41e95 Mon Sep 17 00:00:00 2001 From: Sergey Dudanov Date: Mon, 3 Jul 2023 02:35:53 +0400 Subject: [PATCH] binary_sensor removed unused filter (#5039) --- esphome/components/binary_sensor/filter.cpp | 9 --------- esphome/components/binary_sensor/filter.h | 8 -------- 2 files changed, 17 deletions(-) diff --git a/esphome/components/binary_sensor/filter.cpp b/esphome/components/binary_sensor/filter.cpp index 53c2daf42d..836c341574 100644 --- a/esphome/components/binary_sensor/filter.cpp +++ b/esphome/components/binary_sensor/filter.cpp @@ -114,15 +114,6 @@ LambdaFilter::LambdaFilter(std::function(bool)> f) : f_(std::move optional LambdaFilter::new_value(bool value, bool is_initial) { return this->f_(value); } -optional UniqueFilter::new_value(bool value, bool is_initial) { - if (this->last_value_.has_value() && *this->last_value_ == value) { - return {}; - } else { - this->last_value_ = value; - return value; - } -} - } // namespace binary_sensor } // namespace esphome diff --git a/esphome/components/binary_sensor/filter.h b/esphome/components/binary_sensor/filter.h index 64a33f6e34..0f0ab6875f 100644 --- a/esphome/components/binary_sensor/filter.h +++ b/esphome/components/binary_sensor/filter.h @@ -105,14 +105,6 @@ class LambdaFilter : public Filter { std::function(bool)> f_; }; -class UniqueFilter : public Filter { - public: - optional new_value(bool value, bool is_initial) override; - - protected: - optional last_value_{}; -}; - } // namespace binary_sensor } // namespace esphome