1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-17 10:42:21 +01:00
This commit is contained in:
Guillermo Ruffino
2020-05-24 23:27:28 -03:00
parent a62b6548d2
commit 1bec1faf6d
42 changed files with 151 additions and 176 deletions

View File

@@ -104,8 +104,7 @@ class DFPlayer : public uart::UARTDevice, public Component {
#define DFPLAYER_SIMPLE_ACTION(ACTION_CLASS, ACTION_METHOD) \
template<typename... Ts> class ACTION_CLASS : public Action<Ts...>, public Parented<DFPlayer> { \
protected: \
void play_(Ts... x) override { this->parent_->ACTION_METHOD(); } \
void play(Ts... x) override { this->parent_->ACTION_METHOD(); } \
};
DFPLAYER_SIMPLE_ACTION(NextAction, next)
@@ -116,8 +115,7 @@ template<typename... Ts> class PlayFileAction : public Action<Ts...>, public Par
TEMPLATABLE_VALUE(uint16_t, file)
TEMPLATABLE_VALUE(boolean, loop)
protected:
void play_(Ts... x) override {
void play(Ts... x) override {
auto file = this->file_.value(x...);
auto loop = this->loop_.value(x...);
if (loop) {
@@ -134,8 +132,7 @@ template<typename... Ts> class PlayFolderAction : public Action<Ts...>, public P
TEMPLATABLE_VALUE(uint16_t, file)
TEMPLATABLE_VALUE(boolean, loop)
protected:
void play_(Ts... x) override {
void play(Ts... x) override {
auto folder = this->folder_.value(x...);
auto file = this->file_.value(x...);
auto loop = this->loop_.value(x...);
@@ -151,8 +148,7 @@ template<typename... Ts> class SetDeviceAction : public Action<Ts...>, public Pa
public:
TEMPLATABLE_VALUE(Device, device)
protected:
void play_(Ts... x) override {
void play(Ts... x) override {
auto device = this->device_.value(x...);
this->parent_->set_device(device);
}
@@ -162,8 +158,7 @@ template<typename... Ts> class SetVolumeAction : public Action<Ts...>, public Pa
public:
TEMPLATABLE_VALUE(uint8_t, volume)
protected:
void play_(Ts... x) override {
void play(Ts... x) override {
auto volume = this->volume_.value(x...);
this->parent_->set_volume(volume);
}
@@ -173,8 +168,7 @@ template<typename... Ts> class SetEqAction : public Action<Ts...>, public Parent
public:
TEMPLATABLE_VALUE(EqPreset, eq)
protected:
void play_(Ts... x) override {
void play(Ts... x) override {
auto eq = this->eq_.value(x...);
this->parent_->set_eq(eq);
}