diff --git a/esphome/components/light/light_color_values.h b/esphome/components/light/light_color_values.h index cda86d3f1c..9ac8be1dd0 100644 --- a/esphome/components/light/light_color_values.h +++ b/esphome/components/light/light_color_values.h @@ -185,7 +185,7 @@ class LightColorValues { /// Convert these light color values to an RGBW representation and write them to red, green, blue, white. void as_rgbw(float *red, float *green, float *blue, float *white) const { this->as_rgb(red, green, blue); - *white = this->state_ * this->white_; + *white = this->state_ * this->brightness_ * this->white_; } /// Convert these light color values to an RGBWW representation with the given parameters. @@ -196,8 +196,8 @@ class LightColorValues { const float ww_fraction = (color_temp - color_temperature_cw) / (color_temperature_ww - color_temperature_cw); const float cw_fraction = 1.0f - ww_fraction; const float max_cw_ww = std::max(ww_fraction, cw_fraction); - *cold_white = this->state_ * this->white_ * (cw_fraction / max_cw_ww); - *warm_white = this->state_ * this->white_ * (ww_fraction / max_cw_ww); + *cold_white = this->state_ * this->brightness_ * this->white_ * (cw_fraction / max_cw_ww); + *warm_white = this->state_ * this->brightness_ * this->white_ * (ww_fraction / max_cw_ww); } /// Convert these light color values to an CWWW representation with the given parameters.