[light] Fix incorrect mode change handling on transition to off (#15147)

This commit is contained in:
Fabian Bläse
2026-03-24 19:57:58 +00:00
committed by GitHub
parent 55df21db51
commit 22bc47da23
+3 -3
View File
@@ -27,7 +27,7 @@ class LightTransitionTransformer : public LightTransformer {
}
// When changing color mode, go through off state, as color modes are orthogonal and there can't be two active.
if (this->start_values_.get_color_mode() != this->target_values_.get_color_mode()) {
if (this->start_values_.get_color_mode() != this->end_values_.get_color_mode()) {
this->changing_color_mode_ = true;
this->intermediate_values_ = this->start_values_;
this->intermediate_values_.set_state(false);
@@ -39,8 +39,8 @@ class LightTransitionTransformer : public LightTransformer {
// Halfway through, when intermediate state (off) is reached, flip it to the target, but remain off.
if (this->changing_color_mode_ && p > 0.5f &&
this->intermediate_values_.get_color_mode() != this->target_values_.get_color_mode()) {
this->intermediate_values_ = this->target_values_;
this->intermediate_values_.get_color_mode() != this->end_values_.get_color_mode()) {
this->intermediate_values_ = this->end_values_;
this->intermediate_values_.set_state(false);
}