1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-12 21:05:46 +00:00

Fix ForCondition time duration check

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 11:33:48 +02:00
committed by GitHub
parent 0a21816a5a
commit 43573a42cd

View File

@@ -73,7 +73,7 @@ template<typename... Ts> class ForCondition : public Condition<Ts...>, public Co
bool check(Ts... x) override { bool check(Ts... x) override {
if (!this->check_internal()) if (!this->check_internal())
return false; return false;
return millis() - this->last_inactive_ < this->time_.value(x...); return millis() - this->last_inactive_ >= this->time_.value(x...);
} }
protected: protected: