From c6e3f1bca6df50e3334b538981be27f649720956 Mon Sep 17 00:00:00 2001 From: Peter Tatrai Date: Tue, 4 Jun 2019 18:34:51 +0200 Subject: [PATCH] Fix ForCondition time duration check (#610) According documentation ForCondition should evaluate to true if a nested condition is true for at least the specified time duration and not the less. --- esphome/core/base_automation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/core/base_automation.h b/esphome/core/base_automation.h index ad50a3921f..add3df0bb5 100644 --- a/esphome/core/base_automation.h +++ b/esphome/core/base_automation.h @@ -73,7 +73,7 @@ template class ForCondition : public Condition, public Co bool check(Ts... x) override { if (!this->check_internal()) return false; - return millis() - this->last_inactive_ < this->time_.value(x...); + return millis() - this->last_inactive_ >= this->time_.value(x...); } protected: