mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Update Json Interface (Enable/Disable components during runtime) (#150)
* Update Hyperion.h * Add files via upload * Update CMakeLists.txt * Update Hyperion.cpp * Update JsonClientConnection.cpp * Update JsonClientConnection.h * Update JsonSchemas.qrc * Add files via upload * Update schema.json * Update JsonConnection.cpp * Update JsonConnection.h * Update hyperion-remote.cpp
This commit is contained in:
committed by
brindosch
parent
f183032270
commit
bfb06966de
@@ -260,6 +260,8 @@ void JsonClientConnection::handleMessage(const std::string &messageString)
|
||||
handleSourceSelectCommand(message);
|
||||
else if (command == "configget")
|
||||
handleConfigGetCommand(message);
|
||||
else if (command == "componentstate")
|
||||
handleComponentStateCommand(message);
|
||||
else
|
||||
handleNotImplemented();
|
||||
}
|
||||
@@ -815,6 +817,29 @@ void JsonClientConnection::handleConfigGetCommand(const Json::Value &)
|
||||
sendMessage(result);
|
||||
}
|
||||
|
||||
void JsonClientConnection::handleComponentStateCommand(const Json::Value& message)
|
||||
{
|
||||
const Json::Value & componentState = message["componentstate"];
|
||||
std::string component = componentState.get("component", "").asString();
|
||||
|
||||
if (component == "SMOOTHING")
|
||||
_hyperion->setComponentState((Components)0, componentState.get("state", true).asBool());
|
||||
else if (component == "BLACKBORDER")
|
||||
_hyperion->setComponentState((Components)1, componentState.get("state", true).asBool());
|
||||
else if (component == "KODICHECKER")
|
||||
_hyperion->setComponentState((Components)2, componentState.get("state", true).asBool());
|
||||
else if (component == "FORWARDER")
|
||||
_hyperion->setComponentState((Components)3, componentState.get("state", true).asBool());
|
||||
else if (component == "UDPLISTENER")
|
||||
_hyperion->setComponentState((Components)4, componentState.get("state", true).asBool());
|
||||
else if (component == "BOBLIGHTSERVER")
|
||||
_hyperion->setComponentState((Components)5, componentState.get("state", true).asBool());
|
||||
else if (component == "GRABBER")
|
||||
_hyperion->setComponentState((Components)6, componentState.get("state", true).asBool());
|
||||
|
||||
sendSuccessReply();
|
||||
}
|
||||
|
||||
void JsonClientConnection::handleNotImplemented()
|
||||
{
|
||||
sendErrorReply("Command not implemented");
|
||||
|
Reference in New Issue
Block a user