ESPHome  2025.2.0
automation.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "speaker_media_player.h"
4 
5 #ifdef USE_ESP_IDF
6 
9 
10 namespace esphome {
11 namespace speaker {
12 
13 template<typename... Ts> class PlayOnDeviceMediaAction : public Action<Ts...>, public Parented<SpeakerMediaPlayer> {
14  TEMPLATABLE_VALUE(audio::AudioFile *, audio_file)
15  TEMPLATABLE_VALUE(bool, announcement)
16  TEMPLATABLE_VALUE(bool, enqueue)
17  void play(Ts... x) override {
18  this->parent_->play_file(this->audio_file_.value(x...), this->announcement_.value(x...),
19  this->enqueue_.value(x...));
20  }
21 };
22 
23 } // namespace speaker
24 } // namespace esphome
25 
26 #endif
uint16_t x
Definition: tt21100.cpp:17
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
virtual void play(Ts... x)=0
Helper class to easily give an object a parent of type T.
Definition: helpers.h:538