1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-27 05:03:48 +00:00

Addressable light transition (#750)

* Improve addressable light transition behavior

Fixes https://github.com/esphome/issues/issues/555

* Improve addressable flicker effect

See also https://github.com/esphome/feature-requests/issues/348

* Update addressable_light_effect.h

* Refactor

* Format

* Prevent divide by zero

* Fixes
This commit is contained in:
Otto Winter
2019-10-18 16:27:36 +02:00
committed by GitHub
parent b78b28ea0e
commit 95a74a7f19
6 changed files with 117 additions and 42 deletions

View File

@@ -463,7 +463,7 @@ LightColorValues LightCall::validate_() {
this->transition_length_.reset();
}
if (!this->has_transition_() && !this->has_flash_() && !this->has_effect_() && supports_transition) {
if (!this->has_transition_() && !this->has_flash_() && (!this->has_effect_() || *this->effect_ == 0) && supports_transition) {
// nothing specified and light supports transitions, set default transition length
this->transition_length_ = this->parent_->default_transition_length_;
}