mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 01:07:45 +01:00
Set is_valid to true straight away when min_length is 0 (#1960)
This commit is contained in:
parent
5fca480921
commit
3b940b1c04
1 changed files with 4 additions and 0 deletions
|
@ -80,6 +80,10 @@ void binary_sensor::MultiClickTrigger::schedule_cooldown_() {
|
|||
this->cancel_timeout("is_not_valid");
|
||||
}
|
||||
void binary_sensor::MultiClickTrigger::schedule_is_valid_(uint32_t min_length) {
|
||||
if (min_length == 0) {
|
||||
this->is_valid_ = true;
|
||||
return;
|
||||
}
|
||||
this->is_valid_ = false;
|
||||
this->set_timeout("is_valid", min_length, [this]() {
|
||||
ESP_LOGV(TAG, "Multi Click: You can now %s the button.", this->parent_->state ? "RELEASE" : "PRESS");
|
||||
|
|
Loading…
Reference in a new issue