6static const char *
const TAG =
"binary_sensor.automation";
33 ESP_LOGV(TAG,
"Multi Click: Starting multi click action!");
42 ESP_LOGV(TAG,
"Multi Click: action not started because first level does not match!");
78 ESP_LOGV(TAG,
"Multi Click: Invalid length of press, starting cooldown of %" PRIu32
" ms", this->
invalid_cooldown_);
81 ESP_LOGV(TAG,
"Multi Click: Cooldown ended, matching is now enabled again.");
90 if (min_length == 0) {
95 this->
set_timeout(MULTICLICK_IS_VALID_ID, min_length, [
this]() {
96 ESP_LOGV(TAG,
"Multi Click: You can now %s the button.", this->
parent_->
state ?
"RELEASE" :
"PRESS");
101 this->
set_timeout(MULTICLICK_IS_NOT_VALID_ID, max_length, [
this]() {
102 ESP_LOGV(TAG,
"Multi Click: You waited too long to %s.", this->
parent_->
state ?
"RELEASE" :
"PRESS");
108 ESP_LOGV(TAG,
"Multi Click: Sequence explicitly cancelled.");
113 ESP_LOGV(TAG,
"Multi Click: Hooray, multi click is valid. Triggering!");
122 if (max_length == 0) {
123 return length >= min_length;
ESPDEPRECATED("Use const char* or uint32_t overload instead. Removed in 2026.7.0", "2026.1.0") void set_timeout(const std voi set_timeout)(const char *name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a unique name.
ESPDEPRECATED("Use const char* or uint32_t overload instead. Removed in 2026.7.0", "2026.1.0") bool cancel_timeout(const std boo cancel_timeout)(const char *name)
Cancel a timeout function.
void trigger(const Ts &...x)
void on_state_(bool state)
FixedVector< MultiClickTriggerEvent > timing_
void schedule_is_not_valid_(uint32_t max_length)
uint32_t invalid_cooldown_
void schedule_is_valid_(uint32_t min_length)
optional< size_t > at_index_
void schedule_cooldown_()
constexpr uint32_t MULTICLICK_COOLDOWN_ID
constexpr uint32_t MULTICLICK_IS_NOT_VALID_ID
constexpr uint32_t MULTICLICK_IS_VALID_ID
bool match_interval(uint32_t min_length, uint32_t max_length, uint32_t length)
constexpr uint32_t MULTICLICK_TRIGGER_ID