4#ifdef USE_BINARY_SENSOR_FILTER
20 virtual void input(
bool value);
34 optional<bool>
new_value(
bool value)
override {
return value; }
35 void input(
bool value)
override;
44 optional<bool>
new_value(
bool value)
override;
58 optional<bool>
new_value(
bool value)
override;
70 optional<bool>
new_value(
bool value)
override;
82 optional<bool>
new_value(
bool value)
override;
95 optional<bool>
new_value(
bool value)
override;
126 explicit LambdaFilter(std::function<optional<bool>(
bool)> f);
128 optional<bool>
new_value(
bool value)
override;
131 std::function<optional<bool>(
bool)>
f_;
143 optional<bool>
new_value(
bool value)
override {
return this->
f_(value); }
146 optional<bool> (*
f_)(bool);
151 optional<bool>
new_value(
bool value)
override;
Helper class to deduplicate items in a series of values.
Function-pointer-only templatable storage (4 bytes on 32-bit).
Non-template base for AutorepeatFilter — all methods in filter.cpp.
AutorepeatFilterBase(const AutorepeatFilterBase &)=delete
optional< bool > new_value(bool value) override
float get_setup_priority() const override
void next_value_(bool val)
const AutorepeatFilterTiming * timings_
AutorepeatFilterBase & operator=(const AutorepeatFilterBase &)=delete
AutorepeatFilterBase()=default
Template wrapper that provides inline std::array storage for timings.
std::array< AutorepeatFilterTiming, N > timings_storage_
AutorepeatFilter(std::initializer_list< AutorepeatFilterTiming > timings)
Base class for all binary_sensor-type classes.
float get_setup_priority() const override
optional< bool > new_value(bool value) override
TemplatableFn< uint32_t > delay_
optional< bool > new_value(bool value) override
TemplatableFn< uint32_t > delay_
float get_setup_priority() const override
void set_off_delay(T delay)
TemplatableFn< uint32_t > on_delay_
TemplatableFn< uint32_t > off_delay_
void set_on_delay(T delay)
float get_setup_priority() const override
optional< bool > new_value(bool value) override
virtual void input(bool value)
virtual optional< bool > new_value(bool value)=0
Deduplicator< bool > dedup_
optional< bool > new_value(bool value) override
LambdaFilter(std::function< optional< bool >(bool)> f)
std::function< optional< bool >(bool)> f_
optional< bool > new_value(bool value) override
TemplatableFn< uint32_t > delay_
float get_setup_priority() const override
optional< bool > new_value(bool value) override
Optimized lambda filter for stateless lambdas (no capture).
StatelessLambdaFilter(optional< bool >(*f)(bool))
optional< bool >(* f_)(bool)
optional< bool > new_value(bool value) override
void set_timeout_value(T timeout)
TemplatableFn< uint32_t > timeout_delay_
void input(bool value) override
optional< bool > new_value(bool value) override
void init_array_from(std::array< T, N > &dest, std::initializer_list< T > src)
Initialize a std::array from an initializer_list.
void HOT delay(uint32_t ms)