Skip to content

Commit 6d7955e

Browse files
committed
Guard implementation against no MWW
1 parent 5bac677 commit 6d7955e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

esphome/components/voice_assistant/voice_assistant.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,7 @@ void VoiceAssistant::on_announce(const api::VoiceAssistantAnnounceRequest &msg)
896896
}
897897

898898
void VoiceAssistant::on_set_configuration(const std::vector<std::string> &active_wake_words) {
899+
#ifdef USE_MICRO_WAKE_WORD
899900
if (this->micro_wake_word_) {
900901
// Disable all wake words first
901902
for (auto &model : this->micro_wake_word_->get_wake_words()) {
@@ -912,12 +913,14 @@ void VoiceAssistant::on_set_configuration(const std::vector<std::string> &active
912913
}
913914
}
914915
}
916+
#endif
915917
};
916918

917919
const Configuration &VoiceAssistant::get_configuration() {
918920
this->config_.available_wake_words.clear();
919921
this->config_.active_wake_words.clear();
920922

923+
#ifdef USE_MICRO_WAKE_WORD
921924
if (this->micro_wake_word_) {
922925
this->config_.max_active_wake_words = 1;
923926

@@ -935,9 +938,12 @@ const Configuration &VoiceAssistant::get_configuration() {
935938
this->config_.available_wake_words.push_back(std::move(wake_word));
936939
}
937940
} else {
941+
#endif
938942
// No microWakeWord
939943
this->config_.max_active_wake_words = 0;
944+
#ifdef USE_MICRO_WAKE_WORD
940945
}
946+
#endif
941947

942948
return this->config_;
943949
};

0 commit comments

Comments
 (0)