From ea8f49ad6b97c6fd075184295bbe8da991629630 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Wed, 4 Sep 2024 11:02:00 -0500 Subject: [PATCH] Remove url from VoiceAssistantAnnounceFinished --- esphome/components/voice_assistant/voice_assistant.cpp | 4 ---- esphome/components/voice_assistant/voice_assistant.h | 1 - 2 files changed, 5 deletions(-) diff --git a/esphome/components/voice_assistant/voice_assistant.cpp b/esphome/components/voice_assistant/voice_assistant.cpp index 08c8596..364ba82 100644 --- a/esphome/components/voice_assistant/voice_assistant.cpp +++ b/esphome/components/voice_assistant/voice_assistant.cpp @@ -437,9 +437,7 @@ void VoiceAssistant::loop() { this->set_state_(State::IDLE, State::IDLE); api::VoiceAssistantAnnounceFinished msg; - msg.media_id = this->announce_media_id_; this->api_client_->send_voice_assistant_announce_finished(msg); - this->announce_media_id_ = ""; }); } break; @@ -761,7 +759,6 @@ void VoiceAssistant::on_event(const api::VoiceAssistantEventResponse &msg) { this->defer([this, url]() { #ifdef USE_MEDIA_PLAYER if (this->media_player_ != nullptr) { - this->announce_media_id_ = url; this->media_player_->make_call().set_media_url(url).set_announcement(true).perform(); } #endif @@ -924,7 +921,6 @@ void VoiceAssistant::on_announce(const api::VoiceAssistantAnnounceRequest &msg) #ifdef USE_MEDIA_PLAYER if (this->media_player_ != nullptr) { this->tts_start_trigger_->trigger(msg.text); - this->announce_media_id_ = msg.media_id; this->media_player_->make_call().set_media_url(msg.media_id).set_announcement(true).perform(); this->set_state_(State::STREAMING_RESPONSE, State::STREAMING_RESPONSE); this->tts_end_trigger_->trigger(msg.media_id); diff --git a/esphome/components/voice_assistant/voice_assistant.h b/esphome/components/voice_assistant/voice_assistant.h index 5233a48..33831b8 100644 --- a/esphome/components/voice_assistant/voice_assistant.h +++ b/esphome/components/voice_assistant/voice_assistant.h @@ -264,7 +264,6 @@ class VoiceAssistant : public Component { #endif #ifdef USE_MEDIA_PLAYER media_player::MediaPlayer *media_player_{nullptr}; - std::string announce_media_id_{""}; #endif bool local_output_{false};