From 25d04c759c1a162657f5222b059ea03de8a8d26d Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Thu, 30 May 2019 20:01:58 +0200 Subject: [PATCH] Fix Sun Trigger (#572) * Fix Sun Trigger * Fix cwww lights --- esphome/components/cwww/light.py | 2 +- esphome/components/sun/sun.h | 4 ++-- esphome/dashboard/templates/index.html | 2 +- esphome/dashboard/templates/login.html | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/esphome/components/cwww/light.py b/esphome/components/cwww/light.py index 5d2b4ab2c9..f86f1eace0 100644 --- a/esphome/components/cwww/light.py +++ b/esphome/components/cwww/light.py @@ -25,4 +25,4 @@ def to_code(config): wwhite = yield cg.get_variable(config[CONF_WARM_WHITE]) cg.add(var.set_warm_white(wwhite)) - cg.add(var.set_warm_white_temperature(config[CONF_COLD_WHITE_COLOR_TEMPERATURE])) + cg.add(var.set_warm_white_temperature(config[CONF_WARM_WHITE_COLOR_TEMPERATURE])) diff --git a/esphome/components/sun/sun.h b/esphome/components/sun/sun.h index 2592c75c62..501d122da0 100644 --- a/esphome/components/sun/sun.h +++ b/esphome/components/sun/sun.h @@ -103,7 +103,7 @@ class SunTrigger : public Trigger<>, public PollingComponent, public Parentedlast_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 diff --git a/esphome/dashboard/templates/login.html b/esphome/dashboard/templates/login.html index 7f658a7999..cfe682e776 100644 --- a/esphome/dashboard/templates/login.html +++ b/esphome/dashboard/templates/login.html @@ -65,7 +65,7 @@