Only set wakeword when not in new wakewords (#18095)

This commit is contained in:
Bram Kragten 2023-10-02 21:23:02 +02:00 committed by GitHub
parent 46d1dbcb47
commit 2030feabf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -139,9 +139,14 @@ export class AssistPipelineDetailWakeWord extends LitElement {
return; return;
} }
this._wakeWords = wakewordInfo.wake_words; this._wakeWords = wakewordInfo.wake_words;
fireEvent(this, "value-changed", { if (
value: { ...this.data, wake_word_id: this._wakeWords[0]?.id }, !this.data?.wake_word_id ||
}); !this._wakeWords.some((ww) => ww.id === this.data!.wake_word_id)
) {
fireEvent(this, "value-changed", {
value: { ...this.data, wake_word_id: this._wakeWords[0]?.id },
});
}
} }
static get styles(): CSSResultGroup { static get styles(): CSSResultGroup {