From 6c7bc96109ebcce7afb13b2305a249f7f92ea876 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 22 Nov 2019 11:15:52 +0100 Subject: [PATCH] Fix colorpicker regression --- tasmota/xdrv_01_webserver.ino | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index 59aa737fb..01360ff55 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -385,12 +385,10 @@ const char HTTP_MSG_SLIDER2[] PROGMEM = "
" "
"; const char HTTP_MSG_SLIDER3[] PROGMEM = // HUE -// "

"; - "
" + "
" "
"; const char HTTP_MSG_SLIDER4[] PROGMEM = // SATURATION -// "

"; - "
" + "
" "
"; const char HTTP_MSG_RSTRT[] PROGMEM = "
" D_DEVICE_WILL_RESTART "

"; @@ -1028,16 +1026,15 @@ void HandleRoot(void) changeUIntScale(Settings.light_color[i], 0, 255, 0, 100), 'd', i+1); } } // Settings.flag3.pwm_multi_channels - if ((light_type & 7) > 3) { - char hexColor[65]; - snprintf_P(hexColor, sizeof(hexColor), PSTR("grey,#%02X%02X%02X );border-radius:0.3em;"), Settings.light_color[0],Settings.light_color[1],Settings.light_color[2]); + if ((light_type & 7) > 2) { uint16_t hue; uint8_t sat; uint8_t bri; LightGetHSB(&hue, &sat, &bri); - // AddLog_P2(LOG_LEVEL_INFO, PSTR("HSB: %u %u %u "), hue,sat,bri); - WSContentSend_P(HTTP_MSG_SLIDER3, F("red,orange,yellow,green,blue,indigo,violet,red);border-radius:0.3em;"), 1, 359, hue, 'u'); // hue - WSContentSend_P(HTTP_MSG_SLIDER4, hexColor, 1, 100, changeUIntScale(sat, 0, 255, 0, 100), 'n'); // saturation + WSContentSend_P(HTTP_MSG_SLIDER3, hue); // hue + char hex_color[10]; + snprintf_P(hex_color, sizeof(hex_color), PSTR("%02X%02X%02X"), Settings.light_color[0], Settings.light_color[1], Settings.light_color[2]); + WSContentSend_P(HTTP_MSG_SLIDER4, hex_color, changeUIntScale(sat, 0, 255, 0, 100)); // saturation } } #endif // USE_LIGHT