mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Simplify
This commit is contained in:
parent
35fbfabc84
commit
c1178192ee
@ -216,18 +216,18 @@ int LedDeviceRazer::write(const std::vector<ColorRgb>& ledValues)
|
||||
{
|
||||
int retval = -1;
|
||||
|
||||
QJsonObject effectObj;
|
||||
effectObj.insert("effect", "CHROMA_STATIC");
|
||||
|
||||
ColorRgb color = ledValues[0];
|
||||
int colorParam = (color.red * 65536) + (color.green * 256) + color.blue;
|
||||
|
||||
QJsonObject effectObj;
|
||||
effectObj.insert("effect", "CHROMA_STATIC");
|
||||
QJsonObject param;
|
||||
param.insert("color", colorParam);
|
||||
effectObj.insert("param", param);
|
||||
QJsonDocument data = QJsonDocument(effectObj);
|
||||
|
||||
_restApi->setPath(_razerDeviceType);
|
||||
httpResponse response = _restApi->put(data.toJson(QJsonDocument::Compact));
|
||||
httpResponse response = _restApi->put(effectObj);
|
||||
if (!checkApiError(response))
|
||||
{
|
||||
retval = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user