Fix Sun Trigger (#572)

* Fix Sun Trigger

* Fix cwww lights
This commit is contained in:
Otto Winter
2019-05-30 20:01:58 +02:00
parent b4ec84030e
commit 25d04c759c
4 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -103,7 +103,7 @@ class SunTrigger : public Trigger<>, public PollingComponent, public Parented<Su
crossed = this->last_elevation_ >= this->elevation_ && this->elevation_ > current;
}
if (crossed) {
if (crossed && !isnan(this->last_elevation_)) {
this->trigger();
}
this->last_elevation_ = current;
@@ -111,7 +111,7 @@ class SunTrigger : public Trigger<>, public PollingComponent, public Parented<Su
protected:
bool sunrise_;
double last_elevation_;
double last_elevation_{NAN};
double elevation_;
};