Leddevice refactoring the next part (#253)

* add general switchOff

* refactoring of leddevices regarding ledcount and switchoff

* remove obsolete includes
This commit is contained in:
redPanther
2016-09-23 08:49:22 +02:00
committed by GitHub
parent 5aeec2e1e5
commit d6a34edfb2
71 changed files with 274 additions and 1073 deletions

View File

@@ -1,9 +1,6 @@
// Local-Hyperion includes
#include "LedDevicePhilipsHue.h"
// jsoncpp includes
#include <json/json.h>
// qt includes
#include <QtCore/qmath.h>
#include <QEventLoop>
@@ -205,11 +202,11 @@ int LedDevicePhilipsHue::write(const std::vector<ColorRgb> & ledValues)
// Save light states if not done before.
if (!areStatesSaved())
{
saveStates((unsigned int) ledValues.size());
switchOn((unsigned int) ledValues.size());
saveStates((unsigned int) _ledCount);
switchOn((unsigned int) _ledCount);
}
// If there are less states saved than colors given, then maybe something went wrong before.
if (lights.size() != ledValues.size())
if (lights.size() != (unsigned)_ledCount)
{
restoreStates();
return 0;