From d2542142be8d37c3d290bd5b41e351206448dc36 Mon Sep 17 00:00:00 2001 From: Tim Niggemann Date: Tue, 15 Jul 2014 09:59:01 +0200 Subject: [PATCH] Get the light id from the lamp object. Former-commit-id: 7120af8551c185979c94b2a186f09c883784a882 --- libsrc/leddevice/LedDevicePhilipsHue.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libsrc/leddevice/LedDevicePhilipsHue.cpp b/libsrc/leddevice/LedDevicePhilipsHue.cpp index a78c7fca..94b6bdab 100755 --- a/libsrc/leddevice/LedDevicePhilipsHue.cpp +++ b/libsrc/leddevice/LedDevicePhilipsHue.cpp @@ -31,10 +31,10 @@ int LedDevicePhilipsHue::write(const std::vector & ledValues) { switchOn((unsigned int) ledValues.size()); } // Iterate through colors and set light states. - unsigned int lightId = 0; + unsigned int idx = 0; for (const ColorRgb& color : ledValues) { // 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. ColorPoint 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 & ledValues) { lamp.color = xy; } // Next light id. - lightId++; + idx++; } timer.start(); return 0;