mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Merge pull request #622 from Paulchen-Panther/Beta
Get current LED color (JSON API) Former-commit-id: e7a54e674d982bf06cdd4a6a84741d466b555519
This commit is contained in:
commit
b62acc8c72
@ -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