esphome-ratgdo/components/ratgdo/output/ratgdo_output.h

33 lines
803 B
C
Raw Normal View History

2024-10-28 17:56:16 +00:00
#pragma once
#include "../ratgdo.h"
#include "esphome/components/rtttl/rtttl.h"
#include "esphome/core/component.h"
2024-10-28 17:56:16 +00:00
namespace esphome {
namespace ratgdo {
enum OutputType {
RATGDO_BEEPER
};
2024-10-28 17:56:16 +00:00
class RATGDOOutput : public RATGDOClient, public Component {
public:
void setup() override;
void play();
void finished_playback();
void dump_config() override;
void set_output_type(OutputType output_type);
void set_song(std::string rtttlSong) { this->rtttlSong_ = rtttlSong; }
void set_rtttl(rtttl::Rtttl* output) { this->beeper_ = output; }
2024-10-28 17:56:16 +00:00
protected:
OutputType output_type_;
rtttl::Rtttl* beeper_;
std::string rtttlSong_;
bool repeat_;
};
2024-10-28 17:56:16 +00:00
} // namespace ratgdo
} // namespace esphome