Browse Source

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
pull/2478/head
hamed 2 years ago
committed by GitHub
parent
commit
62d83c6194
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      code/espurna/light.cpp

+ 2
- 2
code/espurna/light.cpp View File

@ -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]);
}


Loading…
Cancel
Save