Prepare conversation agent (#15135)

This commit is contained in:
Paulus Schoutsen 2023-01-19 10:28:03 -05:00 committed by GitHub
parent 2f1d783d22
commit d3e20429a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -84,3 +84,12 @@ export const setConversationOnboarding = (
type: "conversation/onboarding/set", type: "conversation/onboarding/set",
shown: value, shown: value,
}); });
export const prepareConversation = (
hass: HomeAssistant,
language?: string
): Promise<void> =>
hass.callWS({
type: "conversation/prepare",
language,
});

View File

@ -22,6 +22,7 @@ import type { HaTextField } from "../../components/ha-textfield";
import { import {
AgentInfo, AgentInfo,
getAgentInfo, getAgentInfo,
prepareConversation,
processConversationInput, processConversationInput,
setConversationOnboarding, setConversationOnboarding,
} from "../../data/conversation"; } from "../../data/conversation";
@ -220,6 +221,7 @@ export class HaVoiceCommandDialog extends LitElement {
text: this.hass.localize("ui.dialogs.voice_command.how_can_i_help"), text: this.hass.localize("ui.dialogs.voice_command.how_can_i_help"),
}, },
]; ];
prepareConversation(this.hass, this.hass.language);
} }
protected updated(changedProps: PropertyValues) { protected updated(changedProps: PropertyValues) {