Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

Commit e219643

Browse files
committed
Fix addressable lights starting white at boot (#556)
1 parent 6f825c6 commit e219643

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/esphome/light/addressable_light.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ void AddressableLight::write_state(LightState *state) {
128128
auto val = state->get_current_values();
129129
// don't use LightState helper, gamma correction+brightness is handled by ESPColorView
130130
ESPColor color = ESPColor(uint8_t(roundf(val.get_red() * 255.0f)), uint8_t(roundf(val.get_green() * 255.0f)),
131-
uint8_t(roundf(val.get_blue() * 255.0f)), uint8_t(roundf(val.get_white() * 255.0f)));
131+
uint8_t(roundf(val.get_blue() * 255.0f)),
132+
// white is not affected by brightness; so manually scale by state
133+
uint8_t(roundf(val.get_white() * val.get_state() * 255.0f)));
132134

133135
for (int i = 0; i < this->size(); i++) {
134136
(*this)[i] = color;

0 commit comments

Comments
 (0)