figments: command: rewrite command api to use Task instances instead of static functions
This commit is contained in:
@@ -30,26 +30,6 @@ doForceBrightness(Args& args, Print& out)
|
||||
Static<Power>::instance()->forceBrightness(newBrightness);
|
||||
}
|
||||
|
||||
void
|
||||
Power::forceBrightness(uint8_t v)
|
||||
{
|
||||
m_forced = true;
|
||||
FastLED.setBrightness(v);
|
||||
}
|
||||
|
||||
const std::vector<Command> _commands = {
|
||||
{"brightness", doBrightness},
|
||||
{"brightness-force", doForceBrightness},
|
||||
{"on", doOn},
|
||||
{"off", doOff}
|
||||
};
|
||||
|
||||
const std::vector<Command>&
|
||||
Power::commands() const
|
||||
{
|
||||
return _commands;
|
||||
}
|
||||
|
||||
void
|
||||
Power::handleConfigChange(const Configuration& config)
|
||||
{
|
||||
|
@@ -53,9 +53,6 @@ public:
|
||||
}
|
||||
|
||||
void forceBrightness(uint8_t v);
|
||||
|
||||
const std::vector<Command>& commands() const override;
|
||||
|
||||
private:
|
||||
AnimatedNumber m_powerState = 255;
|
||||
AnimatedNumber m_brightness = 255;
|
||||
|
Reference in New Issue
Block a user