mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Updated behaviour of the API to handle instance data requests such as getImageSnapshot and getLedSnapshot.
This commit is contained in:
parent
e7c46f4c9e
commit
a30e67fc11
@ -285,10 +285,24 @@ private:
|
||||
///
|
||||
void handleSystemCommand(const QJsonObject &message, const JsonApiCommand& cmd);
|
||||
|
||||
/// @brief Handle an incoming JSON message for actions related to the current image
|
||||
/// Handle an incoming data request message
|
||||
///
|
||||
/// @param message the incoming message
|
||||
///
|
||||
void handleInstanceDataCommand(const QJsonObject &message, const JsonApiCommand& cmd);
|
||||
|
||||
/// Handle an incoming JSON message to request the current image
|
||||
///
|
||||
/// @param message the incoming message
|
||||
///
|
||||
void handleGetCurrentImageCommand(const QJsonObject &message, const JsonApiCommand& cmd);
|
||||
void handleGetImageSnapshotCommand(const QJsonObject &message, const JsonApiCommand& cmd);
|
||||
|
||||
/// Handle an incoming JSON message to request the current led colors
|
||||
///
|
||||
/// @param message the incoming message
|
||||
///
|
||||
void handleGetLedSnapshotCommand(const QJsonObject &message, const JsonApiCommand& cmd);
|
||||
|
||||
|
||||
void applyColorAdjustments(const QJsonObject &adjustment, ColorAdjustment *colorAdjustment);
|
||||
void applyColorAdjustment(const QString &colorName, const QJsonObject &adjustment, RgbChannelAdjustment &rgbAdjustment);
|
||||
@ -408,4 +422,7 @@ private:
|
||||
|
||||
// The JsonCallbacks instance which handles data subscription/notifications
|
||||
QSharedPointer<JsonCallbacks> _jsonCB;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
@ -23,6 +23,7 @@ public:
|
||||
Image,
|
||||
InputSource,
|
||||
Instance,
|
||||
InstanceData,
|
||||
LedColors,
|
||||
LedDevice,
|
||||
Logging,
|
||||
@ -34,8 +35,7 @@ public:
|
||||
System,
|
||||
Temperature,
|
||||
Transform,
|
||||
VideoMode,
|
||||
GetCurrentImage
|
||||
VideoMode
|
||||
};
|
||||
|
||||
static QString toString(Type type) {
|
||||
@ -54,6 +54,7 @@ public:
|
||||
case Image: return "image";
|
||||
case InputSource: return "inputsource";
|
||||
case Instance: return "instance";
|
||||
case InstanceData: return "instance-data";
|
||||
case LedColors: return "ledcolors";
|
||||
case LedDevice: return "leddevice";
|
||||
case Logging: return "logging";
|
||||
@ -66,7 +67,6 @@ public:
|
||||
case Transform: return "transform";
|
||||
case VideoMode: return "videomode";
|
||||
case Service: return "service";
|
||||
case GetCurrentImage: return "getcurrentimage";
|
||||
default: return "unknown";
|
||||
}
|
||||
}
|
||||
@ -87,7 +87,9 @@ public:
|
||||
Discover,
|
||||
GetConfig,
|
||||
GetConfigOld,
|
||||
GetImageSnapshot,
|
||||
GetInfo,
|
||||
GetLedSnapshot,
|
||||
GetPendingTokenRequests,
|
||||
GetProperties,
|
||||
GetSchema,
|
||||
@ -138,7 +140,9 @@ public:
|
||||
case Discover: return "discover";
|
||||
case GetConfig: return "getconfig";
|
||||
case GetConfigOld: return "getconfig-old";
|
||||
case GetImageSnapshot: return "getImageSnapshot";
|
||||
case GetInfo: return "getInfo";
|
||||
case GetLedSnapshot: return "getLedSnapshot";
|
||||
case GetPendingTokenRequests: return "getPendingTokenRequests";
|
||||
case GetProperties: return "getProperties";
|
||||
case GetSchema: return "getschema";
|
||||
@ -296,6 +300,9 @@ public:
|
||||
{ {"instance", "startInstance"}, { Command::Instance, SubCommand::StartInstance, Authorization::Yes, InstanceCmd::No, NoListenerCmd::Yes} },
|
||||
{ {"instance", "stopInstance"}, { Command::Instance, SubCommand::StopInstance, Authorization::Yes, InstanceCmd::No, NoListenerCmd::Yes} },
|
||||
{ {"instance", "switchTo"}, { Command::Instance, SubCommand::SwitchTo, Authorization::Yes, InstanceCmd::No, NoListenerCmd::Yes} },
|
||||
{ {"instance-data", ""}, { Command::InstanceData, SubCommand::Empty, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes} },
|
||||
{ {"instance-data", "getImageSnapshot"}, { Command::InstanceData, SubCommand::GetImageSnapshot, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes} },
|
||||
{ {"instance-data", "getLedSnapshot"}, { Command::InstanceData, SubCommand::GetLedSnapshot, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes } },
|
||||
{ {"ledcolors", "imagestream-start"}, { Command::LedColors, SubCommand::ImageStreamStart, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes} },
|
||||
{ {"ledcolors", "imagestream-stop"}, { Command::LedColors, SubCommand::ImageStreamStop, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes} },
|
||||
{ {"ledcolors", "ledstream-start"}, { Command::LedColors, SubCommand::LedStreamStart, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes} },
|
||||
@ -324,8 +331,7 @@ public:
|
||||
{ {"system", "toggleIdle"}, { Command::System, SubCommand::ToggleIdle, Authorization::Yes, InstanceCmd::No, NoListenerCmd::Yes} },
|
||||
{ {"temperature", ""}, { Command::Temperature, SubCommand::Empty, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes} },
|
||||
{ {"transform", ""}, { Command::Transform, SubCommand::Empty, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes} },
|
||||
{ {"videomode", ""}, { Command::VideoMode, SubCommand::Empty, Authorization::Yes, InstanceCmd::No, NoListenerCmd::Yes} },
|
||||
{ {"getcurrentimage", ""}, { Command::GetCurrentImage, SubCommand::Empty, Authorization::Yes, InstanceCmd::No, NoListenerCmd::Yes} }
|
||||
{ {"videomode", ""}, { Command::VideoMode, SubCommand::Empty, Authorization::Yes, InstanceCmd::No, NoListenerCmd::Yes} }
|
||||
};
|
||||
return commandLookup;
|
||||
}
|
||||
|
@ -1,19 +0,0 @@
|
||||
{
|
||||
"type":"object",
|
||||
"required":true,
|
||||
"properties":{
|
||||
"command": {
|
||||
"type" : "string",
|
||||
"required" : true,
|
||||
"enum" : ["getcurrentimage"]
|
||||
},
|
||||
"tan" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"path": {
|
||||
"type": "string",
|
||||
"required": false
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
29
libsrc/api/JSONRPC_schema/schema-instancedata.json
Normal file
29
libsrc/api/JSONRPC_schema/schema-instancedata.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"type":"object",
|
||||
"required":true,
|
||||
"properties":{
|
||||
"command": {
|
||||
"type" : "string",
|
||||
"required" : true,
|
||||
"enum" : ["instance-data"]
|
||||
},
|
||||
"subcommand" : {
|
||||
"type" : "string",
|
||||
"required" : true,
|
||||
"enum" : ["getImageSnapshot","getLedSnapshot"]
|
||||
},
|
||||
"instance" : {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"maximum": 255
|
||||
},
|
||||
"filetype" : {
|
||||
"type" : "string",
|
||||
"enum" : ["BMP","JPG","PNG"]
|
||||
},
|
||||
"tan" : {
|
||||
"type" : "integer"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
"command": {
|
||||
"type" : "string",
|
||||
"required" : true,
|
||||
"enum": [ "color", "image", "effect", "create-effect", "delete-effect", "serverinfo", "clear", "clearall", "adjustment", "sourceselect", "config", "componentstate", "ledcolors", "logging", "processing", "sysinfo", "videomode", "authorize", "instance", "leddevice", "inputsource", "service", "system", "transform", "correction", "temperature", "getcurrentimage" ]
|
||||
"enum": [ "color", "image", "effect", "create-effect", "delete-effect", "serverinfo", "clear", "clearall", "adjustment", "sourceselect", "config", "componentstate", "ledcolors", "logging", "processing", "sysinfo", "videomode", "authorize", "instance", "instance-data", "leddevice", "inputsource", "service", "system", "transform", "correction", "temperature" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,6 @@
|
||||
<file alias="schema-color">JSONRPC_schema/schema-color.json</file>
|
||||
<file alias="schema-image">JSONRPC_schema/schema-image.json</file>
|
||||
<file alias="schema-serverinfo">JSONRPC_schema/schema-serverinfo.json</file>
|
||||
<file alias="schema-getcurrentimage">JSONRPC_schema/schema-getcurrentimage.json</file>
|
||||
<file alias="schema-sysinfo">JSONRPC_schema/schema-sysinfo.json</file>
|
||||
<file alias="schema-clear">JSONRPC_schema/schema-clear.json</file>
|
||||
<file alias="schema-clearall">JSONRPC_schema/schema-clearall.json</file>
|
||||
@ -21,6 +20,7 @@
|
||||
<file alias="schema-videomode">JSONRPC_schema/schema-videomode.json</file>
|
||||
<file alias="schema-authorize">JSONRPC_schema/schema-authorize.json</file>
|
||||
<file alias="schema-instance">JSONRPC_schema/schema-instance.json</file>
|
||||
<file alias="schema-instance-data">JSONRPC_schema/schema-instancedata.json</file>
|
||||
<file alias="schema-leddevice">JSONRPC_schema/schema-leddevice.json</file>
|
||||
<file alias="schema-inputsource">JSONRPC_schema/schema-inputsource.json</file>
|
||||
<file alias="schema-service">JSONRPC_schema/schema-service.json</file>
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user