Skip to content

Commit c253222

Browse files
fix(lightbulb): Fixed the color power calculation error
1 parent 9025658 commit c253222

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

components/led/lightbulb_driver/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Bug Fix:
66

77
* Enable new IIC driver in v5.2.6 instead of v5.2.4
8+
* Fixed the color power calculation error
89

910
## v1.7.0 - 2025-02-24
1011

components/led/lightbulb_driver/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.7.0"
1+
version: "1.7.1"
22
description: Provide multiple dimming driver solutions to easily build lightbulb applications
33
url: https://github.com/espressif/esp-iot-solution/tree/master/components/led/lightbulb_driver
44
dependencies:

components/led/lightbulb_driver/src/lightbulb.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,11 @@ static esp_err_t _lightbulb_hsv2rgb(uint16_t hue, uint8_t saturation, uint8_t va
12511251
*red = _red / 255.0;
12521252
*green = _green / 255.0;
12531253
*blue = _blue / 255.0;
1254+
1255+
float total = *red + *green + *blue;
1256+
*red = *red / total;
1257+
*green = *green / total;
1258+
*blue = *blue / total;
12541259
*cold = 0;
12551260
*warm = 0;
12561261

0 commit comments

Comments
 (0)