Files
bobbycar-boardcomputer-firm…/main/actions/ledstripanimationactions.h
CommanderRedYT d829c0d5cb Fixed spelling
2022-06-23 20:15:51 +02:00

31 lines
790 B
C++

#pragma once
// 3rdparty lib includes
#include "actioninterface.h"
// local includes
#include "ledstrip.h"
#include "ledstripdefines.h"
#include "newsettings.h"
#include "bobbyerrorhandler.h"
template<LedstripAnimation type>
class LedStripSetAnimationActionStatic : public virtual espgui::ActionInterface
{
public:
void triggered() override
{
if (auto result = configs.write_config(configs.ledstrip.animationType, type); !result)
BobbyErrorHandler{}.errorOccurred(std::move(result).error());
}
};
class LedStripSetAnimationAction : public virtual espgui::ActionInterface
{
public:
LedStripSetAnimationAction(LedstripAnimation animation) : m_animation{animation} {};
void triggered() override;
private:
const LedstripAnimation m_animation;
};