mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 02:49:51 +00:00
Fix assist conversation language picker (#27764)
This commit is contained in:
@@ -109,15 +109,26 @@ export class AssistPipelineDetailConversation extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _supportedLanguagesChanged(ev) {
|
private _supportedLanguagesChanged(ev) {
|
||||||
if (ev.detail.value === "*") {
|
this._supportedLanguages = ev.detail.value;
|
||||||
|
|
||||||
|
if (
|
||||||
|
this._supportedLanguages === "*" ||
|
||||||
|
!this._supportedLanguages?.includes(
|
||||||
|
this.data?.conversation_language || ""
|
||||||
|
) ||
|
||||||
|
!this.data?.conversation_language
|
||||||
|
) {
|
||||||
// wait for update of conversation_engine
|
// wait for update of conversation_engine
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const value = { ...this.data };
|
const value = { ...this.data };
|
||||||
value.conversation_language = "*";
|
if (this._supportedLanguages === "*") {
|
||||||
|
value.conversation_language = "*";
|
||||||
|
} else {
|
||||||
|
value.conversation_language = this._supportedLanguages?.[0] ?? null;
|
||||||
|
}
|
||||||
fireEvent(this, "value-changed", { value });
|
fireEvent(this, "value-changed", { value });
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
this._supportedLanguages = ev.detail.value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static styles = css`
|
static styles = css`
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ export class DialogVoiceAssistantPipelineDetail extends LitElement {
|
|||||||
<ha-button
|
<ha-button
|
||||||
slot="primaryAction"
|
slot="primaryAction"
|
||||||
@click=${this._updatePipeline}
|
@click=${this._updatePipeline}
|
||||||
.disabled=${this._submitting}
|
.loading=${this._submitting}
|
||||||
dialogInitialFocus
|
dialogInitialFocus
|
||||||
>
|
>
|
||||||
${this._params.pipeline?.id
|
${this._params.pipeline?.id
|
||||||
|
|||||||
Reference in New Issue
Block a user