Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Commit 7120af8

Browse files
author
Tim Niggemann
committed
Get the light id from the lamp object.
1 parent dc7aa99 commit 7120af8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libsrc/leddevice/LedDevicePhilipsHue.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ int LedDevicePhilipsHue::write(const std::vector<ColorRgb> & ledValues) {
3131
switchOn((unsigned int) ledValues.size());
3232
}
3333
// Iterate through colors and set light states.
34-
unsigned int lightId = 0;
34+
unsigned int idx = 0;
3535
for (const ColorRgb& color : ledValues) {
3636
// Get lamp.
37-
HueLamp& lamp = lamps.at(lightId);
37+
HueLamp& lamp = lamps.at(idx);
3838
// Scale colors from [0, 255] to [0, 1] and convert to xy space.
3939
ColorPoint xy;
4040
rgbToXYBrightness(color.red / 255.0f, color.green / 255.0f, color.blue / 255.0f, lamp, xy);
@@ -48,7 +48,7 @@ int LedDevicePhilipsHue::write(const std::vector<ColorRgb> & ledValues) {
4848
lamp.color = xy;
4949
}
5050
// Next light id.
51-
lightId++;
51+
idx++;
5252
}
5353
timer.start();
5454
return 0;

0 commit comments

Comments
 (0)