mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Update Json Interface (return config file) (#144)
* Add handleConfigGetCommand Function * Add handleConfigGetCommand Function * Add schema-configget.json * Add configget * Add new JSON file schema-configget.json * add --configget command to hyperion-remote * Add getConfigFile function * Add getConfigFile function
This commit is contained in:
committed by
redPanther
parent
722d4eb357
commit
0e2f0127fd
@@ -258,6 +258,8 @@ void JsonClientConnection::handleMessage(const std::string &messageString)
|
||||
handleAdjustmentCommand(message);
|
||||
else if (command == "sourceselect")
|
||||
handleSourceSelectCommand(message);
|
||||
else if (command == "configget")
|
||||
handleConfigGetCommand(message);
|
||||
else
|
||||
handleNotImplemented();
|
||||
}
|
||||
@@ -801,6 +803,18 @@ void JsonClientConnection::handleSourceSelectCommand(const Json::Value & message
|
||||
}
|
||||
}
|
||||
|
||||
void JsonClientConnection::handleConfigGetCommand(const Json::Value &)
|
||||
{
|
||||
// create result
|
||||
Json::Value result;
|
||||
result["success"] = true;
|
||||
Json::Value & config = result["result"];
|
||||
config = _hyperion->getJsonConfig();
|
||||
|
||||
// send the result
|
||||
sendMessage(result);
|
||||
}
|
||||
|
||||
void JsonClientConnection::handleNotImplemented()
|
||||
{
|
||||
sendErrorReply("Command not implemented");
|
||||
|
@@ -134,6 +134,12 @@ private:
|
||||
/// @param message the incoming message
|
||||
///
|
||||
void handleSourceSelectCommand(const Json::Value & message);
|
||||
|
||||
/// Handle an incoming JSON GetConfig message
|
||||
///
|
||||
/// @param message the incoming message
|
||||
///
|
||||
void handleConfigGetCommand(const Json::Value & message);
|
||||
|
||||
///
|
||||
/// Handle an incoming JSON message of unknown type
|
||||
|
@@ -12,5 +12,6 @@
|
||||
<file alias="schema-adjustment">schema/schema-adjustment.json</file>
|
||||
<file alias="schema-effect">schema/schema-effect.json</file>
|
||||
<file alias="schema-sourceselect">schema/schema-sourceselect.json</file>
|
||||
<file alias="schema-configget">schema/schema-configget.json</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
12
libsrc/jsonserver/schema/schema-configget.json
Normal file
12
libsrc/jsonserver/schema/schema-configget.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"type":"object",
|
||||
"required":true,
|
||||
"properties":{
|
||||
"command": {
|
||||
"type" : "string",
|
||||
"required" : true,
|
||||
"enum" : ["configget"]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
@@ -5,7 +5,7 @@
|
||||
"command": {
|
||||
"type" : "string",
|
||||
"required" : true,
|
||||
"enum" : ["color", "image", "effect", "serverinfo", "clear", "clearall", "transform", "correction", "temperature", "adjustment", "sourceselect"]
|
||||
"enum" : ["color", "image", "effect", "serverinfo", "clear", "clearall", "transform", "correction", "temperature", "adjustment", "sourceselect", "configget"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user