mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Update JsonClientConnection.cpp
JSON API: Get current LED color Former-commit-id: 0b40c1eb1627afd8077bdf690109609fd531c2fb
This commit is contained in:
parent
a0b81e9d4c
commit
536b51dba1
@ -529,6 +529,21 @@ void JsonClientConnection::handleServerInfoCommand(const Json::Value &)
|
|||||||
activeEffects.append(activeEffect);
|
activeEffects.append(activeEffect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// collect active led colors
|
||||||
|
Json::Value & activeLedColors = info["activeLedColors"] = Json::Value(Json::arrayValue);
|
||||||
|
foreach (int priority, activePriorities) {
|
||||||
|
const Hyperion::InputInfo & priorityInfo = _hyperion->getPriorityInfo(priority);
|
||||||
|
int i=0;
|
||||||
|
Json::Value LEDcolor;
|
||||||
|
for (auto it = priorityInfo.ledColors.begin(); it!=priorityInfo.ledColors.end(); ++it, ++i) {
|
||||||
|
LEDcolor[std::to_string(i)].append(it->red);
|
||||||
|
LEDcolor[std::to_string(i)].append(it->green);
|
||||||
|
LEDcolor[std::to_string(i)].append(it->blue);
|
||||||
|
}
|
||||||
|
|
||||||
|
activeLedColors.append(LEDcolor);
|
||||||
|
}
|
||||||
|
|
||||||
// send the result
|
// send the result
|
||||||
sendMessage(result);
|
sendMessage(result);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user