mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Fix esphome/issues#947 - RGBW(W) white brightness (#925)
This commit is contained in:
		| @@ -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. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user