Skip to content

Commit

Permalink
light: do not update brightness in hsv
Browse files Browse the repository at this point in the history
  • Loading branch information
mcspr committed Oct 23, 2022
1 parent fe00225 commit 2471c16
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions code/espurna/light.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2780,7 +2780,6 @@ void lightHsv(espurna::light::Hsv hsv) {
double b { 0.0 };

auto v = static_cast<double>(hsv.value()) / 100.0;
long brightness { std::lround(v * static_cast<double>(espurna::light::BrightnessMax)) };

if (hsv.saturation()) {
auto h = hsv.hue();
Expand Down Expand Up @@ -2822,16 +2821,11 @@ void lightHsv(espurna::light::Hsv hsv) {
r = (r + m) * 255.0;
g = (g + m) * 255.0;
b = (b + m) * 255.0;
} else {
r = brightness;
g = brightness;
b = brightness;
}

_light_mapping.red(std::lround(r));
_light_mapping.green(std::lround(g));
_light_mapping.blue(std::lround(b));
lightBrightness(brightness);
}

void lightHs(long hue, long saturation) {
Expand Down

0 comments on commit 2471c16

Please sign in to comment.