Small performance improvement if off on black is true.

Former-commit-id: dc69a21681432bef540c396847d64b07fa0bbb09
This commit is contained in:
ntim 2015-02-05 09:50:05 +01:00
parent a1d489f62f
commit 4f7524d8de

View File

@ -166,10 +166,6 @@ int LedDevicePhilipsHue::write(const std::vector<ColorRgb> & ledValues) {
CiColor xy = lamp.rgbToCiColor(color.red / 255.0f, color.green / 255.0f, color.blue / 255.0f); CiColor xy = lamp.rgbToCiColor(color.red / 255.0f, color.green / 255.0f, color.blue / 255.0f);
// Write color if color has been changed. // Write color if color has been changed.
if (xy != lamp.color) { if (xy != lamp.color) {
// Switch on if the lamp has been previously switched off.
if (switchOffOnBlack && lamp.color == lamp.black) {
put(getStateRoute(lamp.id), QString("{\"on\": true}"));
}
// Send adjust color and brightness command in JSON format. // Send adjust color and brightness command in JSON format.
// We have to set the transition time each time. // We have to set the transition time each time.
put(getStateRoute(lamp.id), put(getStateRoute(lamp.id),