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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user