mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
adds ability to set static color on boot.
Former-commit-id: 41ca5ba73fde698d73380fac3dcee5e33b310d76
This commit is contained in:
@@ -127,19 +127,33 @@ int main(int argc, char** argv)
|
||||
const std::string effectName = effectConfig["effect"].asString();
|
||||
const unsigned duration_ms = effectConfig["duration_ms"].asUInt();
|
||||
const int priority = effectConfig["priority"].asUInt();
|
||||
const int bootcolor_priority = (priority > 990) ? priority+1 : 990;
|
||||
|
||||
hyperion.setColor(priority+1, ColorRgb::BLACK, duration_ms, false);
|
||||
if ( ! effectConfig["color"].isNull() && effectConfig["color"].isArray() && effectConfig["color"].size() == 3 )
|
||||
{
|
||||
ColorRgb boot_color = {
|
||||
(uint8_t)effectConfig["color"][0].asUInt(),
|
||||
(uint8_t)effectConfig["color"][1].asUInt(),
|
||||
(uint8_t)effectConfig["color"][2].asUInt()
|
||||
};
|
||||
|
||||
hyperion.setColor(bootcolor_priority, boot_color, 0, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
hyperion.setColor(bootcolor_priority, ColorRgb::BLACK, duration_ms, false);
|
||||
}
|
||||
|
||||
if (effectConfig.isMember("args"))
|
||||
{
|
||||
const Json::Value effectConfigArgs = effectConfig["args"];
|
||||
if (hyperion.setEffect(effectName, effectConfigArgs, priority, duration_ms) == 0)
|
||||
{
|
||||
std::cout << "Boot sequence(" << effectName << ") with user-defined arguments created and started" << std::endl;
|
||||
std::cout << "Boot sequence(" << effectName << ") with user-defined arguments created and started" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Failed to start boot sequence: " << effectName << " with user-defined arguments" << std::endl;
|
||||
std::cout << "Failed to start boot sequence: " << effectName << " with user-defined arguments" << std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user