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.
This commit is contained in:
Peter Tatrai 2019-06-04 18:34:51 +02:00 committed by Otto Winter
parent a933d4aeb6
commit c6e3f1bca6
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E

View File

@ -73,7 +73,7 @@ template<typename... Ts> class ForCondition : public Condition<Ts...>, 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: