#pragma once #include "esphome/core/automation.h" #include "media_player.h" namespace esphome { namespace media_player { template class PlayAction : public Action, public Parented { void play(Ts... x) override { this->parent_->make_call().set_command(MediaPlayerCommand::MEDIA_PLAYER_COMMAND_PLAY).perform(); } }; template class ToggleAction : public Action, public Parented { void play(Ts... x) override { this->parent_->make_call().set_command(MediaPlayerCommand::MEDIA_PLAYER_COMMAND_TOGGLE).perform(); } }; template class PauseAction : public Action, public Parented { void play(Ts... x) override { this->parent_->make_call().set_command(MediaPlayerCommand::MEDIA_PLAYER_COMMAND_PAUSE).perform(); } }; template class StopAction : public Action, public Parented { void play(Ts... x) override { this->parent_->make_call().set_command(MediaPlayerCommand::MEDIA_PLAYER_COMMAND_STOP).perform(); } }; } // namespace media_player } // namespace esphome