Fix 1181 - Effects were not started from tray (#1199)

* Fix 1181, add constants and defaults

* Include #1195 changes
This commit is contained in:
LordGrey
2021-03-19 22:52:41 +01:00
committed by GitHub
parent 41af5c1b9e
commit 94d9b02734
12 changed files with 40 additions and 98 deletions

View File

@@ -7,6 +7,7 @@
#include <hyperion/LedString.h>
// fg effect
#include <hyperion/Hyperion.h>
#include <hyperion/PriorityMuxer.h>
///
/// @brief Provide utility methods for Hyperion class
@@ -16,7 +17,6 @@ namespace hyperion {
void handleInitialEffect(Hyperion* hyperion, const QJsonObject& FGEffectConfig)
{
#define FGCONFIG_ARRAY fgColorConfig.toArray()
const int FG_PRIORITY = 0;
const int DURATION_INFINITY = 0;
// initial foreground effect/color
@@ -41,12 +41,12 @@ namespace hyperion {
static_cast<uint8_t>(FGCONFIG_ARRAY.at(2).toInt(0))
}
};
hyperion->setColor(FG_PRIORITY, fg_color, fg_duration_ms);
hyperion->setColor(PriorityMuxer::FG_PRIORITY, fg_color, fg_duration_ms);
Info(Logger::getInstance("HYPERION"),"Initial foreground color set (%d %d %d)",fg_color.at(0).red,fg_color.at(0).green,fg_color.at(0).blue);
}
else
{
int result = hyperion->setEffect(fgEffectConfig, FG_PRIORITY, fg_duration_ms);
int result = hyperion->setEffect(fgEffectConfig, PriorityMuxer::FG_PRIORITY, fg_duration_ms);
Info(Logger::getInstance("HYPERION"),"Initial foreground effect '%s' %s", QSTRING_CSTR(fgEffectConfig), ((result == 0) ? "started" : "failed"));
}
}