1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-28 16:12:24 +01:00

Add ANNOUNCING state to media_player. (#6691)

This commit is contained in:
Mischa Siekmann
2024-05-14 11:40:08 +02:00
committed by GitHub
parent d5eeab81d6
commit 6f53607e5a
11 changed files with 76 additions and 7 deletions

View File

@@ -318,7 +318,7 @@ void VoiceAssistant::loop() {
#endif
#ifdef USE_MEDIA_PLAYER
if (this->media_player_ != nullptr) {
playing = (this->media_player_->state == media_player::MediaPlayerState::MEDIA_PLAYER_STATE_PLAYING);
playing = (this->media_player_->state == media_player::MediaPlayerState::MEDIA_PLAYER_STATE_ANNOUNCING);
}
#endif
if (playing) {
@@ -640,7 +640,7 @@ void VoiceAssistant::on_event(const api::VoiceAssistantEventResponse &msg) {
this->defer([this, url]() {
#ifdef USE_MEDIA_PLAYER
if (this->media_player_ != nullptr) {
this->media_player_->make_call().set_media_url(url).perform();
this->media_player_->make_call().set_media_url(url).set_announcement(true).perform();
}
#endif
this->tts_end_trigger_->trigger(url);