mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Leddevice refactoring the next part (#253)
* add general switchOff * refactoring of leddevices regarding ledcount and switchoff * remove obsolete includes
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user