From 62d83c6194630076fa198ddbf0a899ae7fb79672 Mon Sep 17 00:00:00 2001 From: hamed Date: Sun, 26 Sep 2021 02:08:54 +0330 Subject: [PATCH] light: fix rgb hex parser swapped blue and green values (#2474) This was causing WebUI colorpicker to jump between positions in rgb mode, after the websocket immediately reported back rgb tuple containing different values --- code/espurna/light.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/espurna/light.cpp b/code/espurna/light.cpp index 5f9dff75..6ce31d43 100644 --- a/code/espurna/light.cpp +++ b/code/espurna/light.cpp @@ -988,8 +988,8 @@ void _lightFromHexPayload(const char* payload, size_t len) { uint8_t values[4] {0, 0, 0, 0}; if (hexDecode(payload, len, values, sizeof(values))) { _light_mapping.red(values[0]); - _light_mapping.blue(values[1]); - _light_mapping.green(values[2]); + _light_mapping.green(values[1]); + _light_mapping.blue(values[2]); if (WithBrightness) { lightBrightness(values[3]); }