ESPHome 2026.5.0b1
Loading...
Searching...
No Matches
automation.h
Go to the documentation of this file.
1#pragma once
2
4
5#ifdef USE_ESP32
6
9
10namespace esphome::speaker {
11
12template<typename... Ts> class PlayOnDeviceMediaAction : public Action<Ts...>, public Parented<SpeakerMediaPlayer> {
13 TEMPLATABLE_VALUE(audio::AudioFile *, audio_file)
14 TEMPLATABLE_VALUE(bool, announcement)
15 TEMPLATABLE_VALUE(bool, enqueue)
16 void play(const Ts &...x) override {
17 this->parent_->play_file(this->audio_file_.value(x...), this->announcement_.value(x...),
18 this->enqueue_.value(x...));
19 }
20};
21
22} // namespace esphome::speaker
23
24#endif
virtual void play(const Ts &...x)=0
Helper class to easily give an object a parent of type T.
Definition helpers.h:1861
uint16_t x
Definition tt21100.cpp:5