ESPHome 2025.5.0
Loading...
Searching...
No Matches
automation.h
Go to the documentation of this file.
1#pragma once
2
4
5#ifdef USE_ESP_IDF
6
9
10namespace esphome {
11namespace speaker {
12
13template<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
virtual void play(Ts... x)=0
Helper class to easily give an object a parent of type T.
Definition helpers.h:538
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
uint16_t x
Definition tt21100.cpp:5