Skip to content

Commit

Permalink
[micro_wake_word] remove unused enable_wake_words function (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
kahrendt committed Sep 23, 2024
1 parent e78b64e commit 551c4cc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
17 changes: 0 additions & 17 deletions esphome/components/micro_wake_word/micro_wake_word.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,23 +350,6 @@ void MicroWakeWord::loop() {
}
}

void MicroWakeWord::enable_wake_words(std::vector<std::string> &wake_words_to_enable) {
// Disable and unload all models
for (auto &model : this->wake_word_models_) {
model->disable();
}

delay(20); // make sure the models have actually unloaded

for (auto &model : this->wake_word_models_) {
for (auto &wake_word : wake_words_to_enable) {
if (!model->get_wake_word().compare(wake_word)) {
model->enable();
}
}
}
}

void MicroWakeWord::start() {
if (!this->is_ready()) {
ESP_LOGW(TAG, "Wake word detection can't start as the component hasn't been setup yet");
Expand Down
4 changes: 0 additions & 4 deletions esphome/components/micro_wake_word/micro_wake_word.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ class MicroWakeWord : public Component {
// Since these are pointers to the WakeWordModel objects, the voice assistant component can enable or disable them
const std::vector<WakeWordModel *> &get_wake_words() const { return this->wake_word_models_; }

// Enables the wake word phrases given as strings in a vector. Disables any wake words not listed in the vector
// TODO: Should this logic be in the voice_assistant component?
void enable_wake_words(std::vector<std::string> &wake_words_to_enable);

protected:
microphone::Microphone *microphone_{nullptr};
Trigger<std::string> *wake_word_detected_trigger_ = new Trigger<std::string>();
Expand Down

0 comments on commit 551c4cc

Please sign in to comment.