3#include <ArduinoJson.h>
18 DelayedAction(std::unique_ptr<Action> action, uint32_t delayMs);
22 uint32_t
getDelay()
const override {
return delayMs; }
23 bool isSendAction()
const override {
return action->isSendAction(); }
33 bool update(uint32_t currentTime)
const;
42 std::unique_ptr<Action> action;
44 uint32_t startTime = 0;
Base class for all pedal actions.
Wraps an action and defers its execution by a configurable delay.
uint32_t getDelay() const override
const Action * getInnerAction() const
static const char * getTypeName(Action::Type type)
Converts an Action::Type enum to its string representation.
bool update(uint32_t currentTime) const
Polls whether the delay has elapsed.
void execute() override
Executes the delayed action.
bool isSendAction() const override
bool isInProgress() const override
Returns true if the action is currently in progress (e.g.
void getJsonProperties(JsonObject &json) const override
Serializes the delayed action to JSON.
Action::Type getType() const override