From 7036057dd0f6cedc2176594c8c8f67f6451f7c8a Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 1 Dec 2025 17:06:22 +0100 Subject: [PATCH] Fix GUI Saturation slider gradient update when using color or dimmer command --- .../tasmota_xdrv_driver/xdrv_01_9_webserver.ino | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino b/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino index bb769ee57..c713d0697 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino @@ -1926,30 +1926,34 @@ bool HandleRootStatusRefresh(void) { #ifdef USE_LIGHT uint16_t hue; uint8_t sat; + bool hue_bri_change = false; int current_value = -1; for (uint32_t i = 0; i < LST_MAX; i++) { if (Web.slider[i] != -1) { if (!Settings->flag3.pwm_multi_channels) { // SetOption68 0 - Enable multi-channels PWM instead of Color PWM - if (0 == i) { + if (0 == i) { // Cold / Warm current_value = LightGetColorTemp(); } - else if (1 == i) { + else if (1 == i) { // Hue LightGetHSB(&hue, &sat, nullptr); current_value = hue; } - else if (2 == i) { + else if (2 == i) { // Saturation current_value = changeUIntScale(sat, 0, 255, 0, 100); } - else if (3 == i) { + else if (3 == i) { // Dimmer - Color current_value = Settings->light_dimmer; } - else if (4 == i) { + else if (4 == i) { // Dimmer2 - White current_value = LightGetDimmer(2); } } else { current_value = changeUIntScale(Settings->light_color[i], 0, 255, 0, 100); } if (current_value != Web.slider[i]) { + if ((1 == i) || (3 == i)) { // Hue or Dimmer change needs Saturation slider gradient update + hue_bri_change = true; + } if (WebUpdateSliderTime()) { Web.slider[i] = current_value; } @@ -1961,6 +1965,9 @@ bool HandleRootStatusRefresh(void) { } } } + if (hue_bri_change) { + WSContentSend_P(PSTR("lc('h',99,0);")); // Update Saturation slider color gradient when command color/dimmer is executed + } #endif // USE_LIGHT if (msg_exec_javascript) {