mirror of
https://github.com/esphome/esphome.git
synced 2026-10-02 01:10:22 +00:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user