Skip to content

Commit

Permalink
Add an All Lights Off command
Browse files Browse the repository at this point in the history
  • Loading branch information
dkulp committed Nov 11, 2019
1 parent 6207a21 commit 3319935
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/commands/EventCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "effects.h"
#include "scripts.h"
#include "Sequence.h"

std::unique_ptr<Command::Result> TriggerEventCommand::run(const std::vector<std::string> &args) {
if (args.size() != 2) {
Expand Down Expand Up @@ -140,3 +141,8 @@ std::unique_ptr<Command::Result> RunRemoteScriptEvent::run(const std::vector<std
return CommandManager::INSTANCE.runRemoteCommand(args[0], "Run Script", newargs);
}

std::unique_ptr<Command::Result> AllLightsOffCommand::run(const std::vector<std::string> &args) {
sequence->SendBlankingData();
return std::make_unique<Command::Result>("All Lights Off");
}

10 changes: 10 additions & 0 deletions src/commands/EventCommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,14 @@ class StopRemoteEffectCommand : public Command {

virtual std::unique_ptr<Command::Result> run(const std::vector<std::string> &args) override;
};


class AllLightsOffCommand : public Command {
public:
AllLightsOffCommand() : Command("All Lights Off") {
}

virtual std::unique_ptr<Command::Result> run(const std::vector<std::string> &args) override;
};

#endif

0 comments on commit 3319935

Please sign in to comment.