Get the light id from the lamp object.

Former-commit-id: dc7aa992386c2511261614a2a8fe3ccf15d9a591
This commit is contained in:
Tim Niggemann 2014-07-15 09:58:29 +02:00
parent 67970fce08
commit 4af2b11d8f

View File

@ -41,9 +41,9 @@ int LedDevicePhilipsHue::write(const std::vector<ColorRgb> & ledValues) {
// Write color if color has been changed. // Write color if color has been changed.
if (xy != lamp.color) { if (xy != lamp.color) {
// Send adjust color command in JSON format. // Send adjust color command in JSON format.
put(getStateRoute(lightId), QString("{\"xy\": [%1, %2]}").arg(xy.x).arg(xy.y)); put(getStateRoute(lamp.id), QString("{\"xy\": [%1, %2]}").arg(xy.x).arg(xy.y));
// Send brightness color command in JSON format. // Send brightness color command in JSON format.
put(getStateRoute(lightId), QString("{\"bri\": %1}").arg(qRound(xy.bri * 255.0f))); put(getStateRoute(lamp.id), QString("{\"bri\": %1}").arg(qRound(xy.bri * 255.0f)));
// Remember written color. // Remember written color.
lamp.color = xy; lamp.color = xy;
} }