mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Get the light id from the lamp object.
Former-commit-id: 7120af8551c185979c94b2a186f09c883784a882
This commit is contained in:
parent
4af2b11d8f
commit
d2542142be
@ -31,10 +31,10 @@ int LedDevicePhilipsHue::write(const std::vector<ColorRgb> & ledValues) {
|
|||||||
switchOn((unsigned int) ledValues.size());
|
switchOn((unsigned int) ledValues.size());
|
||||||
}
|
}
|
||||||
// Iterate through colors and set light states.
|
// Iterate through colors and set light states.
|
||||||
unsigned int lightId = 0;
|
unsigned int idx = 0;
|
||||||
for (const ColorRgb& color : ledValues) {
|
for (const ColorRgb& color : ledValues) {
|
||||||
// Get lamp.
|
// Get lamp.
|
||||||
HueLamp& lamp = lamps.at(lightId);
|
HueLamp& lamp = lamps.at(idx);
|
||||||
// Scale colors from [0, 255] to [0, 1] and convert to xy space.
|
// Scale colors from [0, 255] to [0, 1] and convert to xy space.
|
||||||
ColorPoint xy;
|
ColorPoint xy;
|
||||||
rgbToXYBrightness(color.red / 255.0f, color.green / 255.0f, color.blue / 255.0f, lamp, xy);
|
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) {
|
|||||||
lamp.color = xy;
|
lamp.color = xy;
|
||||||
}
|
}
|
||||||
// Next light id.
|
// Next light id.
|
||||||
lightId++;
|
idx++;
|
||||||
}
|
}
|
||||||
timer.start();
|
timer.start();
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user