[voice_assistant] Do not enable internal-only wake words on request

The disable-all loop iterates get_wake_words(), which filters out internal-only
models, but the enable path uses get_model_by_id(), which does not. Enabling one
from a set_configuration request left it active with no way to turn it off short
of a reboot.
This commit is contained in:
Kevin Ahrendt
2026-08-10 08:11:47 -04:00
parent 68aa3b87aa
commit 2b01e48d1b
@@ -1120,6 +1120,12 @@ void VoiceAssistant::on_set_configuration(const std::vector<std::string> &active
for (const auto &ww_id : active_wake_words) {
// Already loaded (compiled or previously downloaded) enable() persists the state.
if (auto *model = this->micro_wake_word_->get_model_by_id(ww_id)) {
// get_model_by_id does not filter internal-only models, but the disable loop above iterates
// get_wake_words(), which does. Enabling one here would leave it stuck on until a reboot.
if (model->get_internal_only()) {
ESP_LOGW(TAG, "Ignoring request to enable internal-only wake word: %s", ww_id.c_str());
continue;
}
model->enable();
ESP_LOGD(TAG, "Enabled wake word: %s (id=%s)", model->get_wake_word().c_str(), model->get_id().c_str());
continue;