1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-31 15:12:06 +00:00

[voice_assistant] Add announce support (#8232)

This commit is contained in:
Kevin Ahrendt
2025-02-11 12:20:39 -06:00
committed by GitHub
parent 46d19d82c2
commit 33f9d66e81
2 changed files with 32 additions and 14 deletions

View File

@@ -40,6 +40,7 @@ enum VoiceAssistantFeature : uint32_t {
FEATURE_SPEAKER = 1 << 1,
FEATURE_API_AUDIO = 1 << 2,
FEATURE_TIMERS = 1 << 3,
FEATURE_ANNOUNCE = 1 << 4,
};
enum class State {
@@ -136,6 +137,12 @@ class VoiceAssistant : public Component {
flags |= VoiceAssistantFeature::FEATURE_TIMERS;
}
#ifdef USE_MEDIA_PLAYER
if (this->media_player_ != nullptr) {
flags |= VoiceAssistantFeature::FEATURE_ANNOUNCE;
}
#endif
return flags;
}
@@ -209,6 +216,7 @@ class VoiceAssistant : public Component {
void set_state_(State state);
void set_state_(State state, State desired_state);
void signal_stop_();
void start_playback_timeout_();
std::unique_ptr<socket::Socket> socket_ = nullptr;
struct sockaddr_storage dest_addr_;