8namespace binary_sensor {
10static const char *
const TAG =
"sensor.filter";
16 if (this->
next_ ==
nullptr) {
23 auto b = this->
new_value(value, is_initial);
25 this->
output(*b, is_initial);
117 this->steady_ = true;
118 this->output(value, is_initial);
123 this->
output(value, is_initial);
bool cancel_timeout(const std::string &name)
Cancel a timeout function.
void set_timeout(const std::string &name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a unique name.
bool next(T value)
Feeds the next item in the series to the deduplicator and returns whether this is a duplicate.
AutorepeatFilter(std::vector< AutorepeatFilterTiming > timings)
float get_setup_priority() const override
void next_value_(bool val)
std::vector< AutorepeatFilterTiming > timings_
optional< bool > new_value(bool value, bool is_initial) override
void send_state_internal(bool state, bool is_initial)
float get_setup_priority() const override
optional< bool > new_value(bool value, bool is_initial) override
TemplatableValue< uint32_t > delay_
TemplatableValue< uint32_t > delay_
float get_setup_priority() const override
optional< bool > new_value(bool value, bool is_initial) override
optional< bool > new_value(bool value, bool is_initial) override
TemplatableValue< uint32_t > on_delay_
float get_setup_priority() const override
TemplatableValue< uint32_t > off_delay_
virtual optional< bool > new_value(bool value, bool is_initial)=0
Deduplicator< bool > dedup_
void input(bool value, bool is_initial)
void output(bool value, bool is_initial)
optional< bool > new_value(bool value, bool is_initial) override
LambdaFilter(std::function< optional< bool >(bool)> f)
std::function< optional< bool >(bool)> f_
optional< bool > new_value(bool value, bool is_initial) override
optional< bool > new_value(bool value, bool is_initial) override
float get_setup_priority() const override
TemplatableValue< uint32_t > delay_
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Providing packet encoding functions for exchanging data with a remote host.
void IRAM_ATTR HOT delay(uint32_t ms)