Hyperion Light 2 (#1428)

* Hyperion Light - Have EffectEngine as component

* Hyperion light - Build switches for LED Devices (Serial, Network)

* Fix file uri generation

* Fix missing guard for Windows

* Fix file uri generation

* Update jsonschema and checkschema

* Allow to provide cmake build args to docker build
This commit is contained in:
LordGrey
2022-02-11 20:36:15 +01:00
committed by GitHub
parent 9e4b58d5c6
commit 5078688dc8
47 changed files with 1920 additions and 938 deletions

View File

@@ -185,12 +185,14 @@ proceed:
handleColorCommand(message, command, tan);
else if (command == "image")
handleImageCommand(message, command, tan);
#if defined(ENABLE_EFFECTENGINE)
else if (command == "effect")
handleEffectCommand(message, command, tan);
else if (command == "create-effect")
handleCreateEffectCommand(message, command, tan);
else if (command == "delete-effect")
handleDeleteEffectCommand(message, command, tan);
#endif
else if (command == "sysinfo")
handleSysInfoCommand(message, command, tan);
else if (command == "serverinfo")
@@ -275,6 +277,7 @@ void JsonAPI::handleImageCommand(const QJsonObject &message, const QString &comm
sendSuccessReply(command, tan);
}
#if defined(ENABLE_EFFECTENGINE)
void JsonAPI::handleEffectCommand(const QJsonObject &message, const QString &command, int tan)
{
emit forwardJsonMessage(message);
@@ -305,6 +308,7 @@ void JsonAPI::handleDeleteEffectCommand(const QJsonObject &message, const QStrin
const QString res = API::deleteEffect(message["name"].toString());
res.isEmpty() ? sendSuccessReply(command, tan) : sendErrorReply(res, command, tan);
}
#endif
void JsonAPI::handleSysInfoCommand(const QJsonObject &, const QString &command, int tan)
{
@@ -332,7 +336,9 @@ void JsonAPI::handleSysInfoCommand(const QJsonObject &, const QString &command,
system["domainName"] = data.domainName;
system["isUserAdmin"] = data.isUserAdmin;
system["qtVersion"] = data.qtVersion;
#if defined(ENABLE_EFFECTENGINE)
system["pyVersion"] = data.pyVersion;
#endif
info["system"] = system;
QJsonObject hyperion;
@@ -485,6 +491,7 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString
info["adjustment"] = adjustmentArray;
#if defined(ENABLE_EFFECTENGINE)
// collect effect info
QJsonArray effects;
const std::list<EffectDefinition> &effectsDefinitions = _hyperion->getEffects();
@@ -499,6 +506,7 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString
}
info["effects"] = effects;
#endif
// get available led devices
QJsonObject ledDevices;
@@ -596,6 +604,10 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString
services.append("cec");
#endif
#if defined(ENABLE_EFFECTENGINE)
services.append("effectengine");
#endif
#if defined(ENABLE_FORWARDER)
services.append("forwarder");
#endif
@@ -701,6 +713,7 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString
}
info["transform"] = transformArray;
#if defined(ENABLE_EFFECTENGINE)
// ACTIVE EFFECT INFO
QJsonArray activeEffects;
for (const ActiveEffectDefinition &activeEffectDefinition : _hyperion->getActiveEffects())
@@ -717,6 +730,7 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString
}
}
info["activeEffects"] = activeEffects;
#endif
// ACTIVE STATIC LED COLOR
QJsonArray activeLedColors;
@@ -1036,6 +1050,7 @@ void JsonAPI::handleSchemaGetCommand(const QJsonObject &message, const QString &
alldevices = LedDeviceWrapper::getLedDeviceSchemas();
properties.insert("alldevices", alldevices);
#if defined(ENABLE_EFFECTENGINE)
// collect all available effect schemas
QJsonArray schemaList;
const std::list<EffectSchema>& effectsSchemas = _hyperion->getEffectSchemas();
@@ -1056,6 +1071,7 @@ void JsonAPI::handleSchemaGetCommand(const QJsonObject &message, const QString &
schemaList.append(schema);
}
properties.insert("effectSchemas", schemaList);
#endif
schemaJson.insert("properties", properties);