mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Remove onboarding support for conversation agent (#15187)
This commit is contained in:
parent
c4183a9edb
commit
8b4b19cc96
@ -54,7 +54,6 @@ interface ConversationResult {
|
||||
|
||||
export interface AgentInfo {
|
||||
attribution?: { name: string; url: string };
|
||||
onboarding?: { text: string; url: string };
|
||||
}
|
||||
|
||||
export const processConversationInput = (
|
||||
@ -76,15 +75,6 @@ export const getAgentInfo = (hass: HomeAssistant): Promise<AgentInfo> =>
|
||||
type: "conversation/agent/info",
|
||||
});
|
||||
|
||||
export const setConversationOnboarding = (
|
||||
hass: HomeAssistant,
|
||||
value: boolean
|
||||
): Promise<boolean> =>
|
||||
hass.callWS({
|
||||
type: "conversation/onboarding/set",
|
||||
shown: value,
|
||||
});
|
||||
|
||||
export const prepareConversation = (
|
||||
hass: HomeAssistant,
|
||||
language?: string
|
||||
|
@ -24,7 +24,6 @@ import {
|
||||
getAgentInfo,
|
||||
prepareConversation,
|
||||
processConversationInput,
|
||||
setConversationOnboarding,
|
||||
} from "../../data/conversation";
|
||||
import { haStyleDialog } from "../../resources/styles";
|
||||
import type { HomeAssistant } from "../../types";
|
||||
@ -107,30 +106,6 @@ export class HaVoiceCommandDialog extends LitElement {
|
||||
</div>
|
||||
<div class="messages">
|
||||
<div class="messages-container" id="scroll-container">
|
||||
${this._agentInfo && this._agentInfo.onboarding
|
||||
? html`
|
||||
<div class="onboarding">
|
||||
${this._agentInfo.onboarding.text}
|
||||
<div
|
||||
class="side-by-side"
|
||||
@click=${this._completeOnboarding}
|
||||
>
|
||||
<a
|
||||
class="button"
|
||||
href=${this._agentInfo.onboarding.url}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
><mwc-button unelevated
|
||||
>${this.hass.localize("ui.common.yes")}!</mwc-button
|
||||
></a
|
||||
>
|
||||
<mwc-button outlined
|
||||
>${this.hass.localize("ui.common.no")}</mwc-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
: ""}
|
||||
${this._conversation.map(
|
||||
(message) => html`
|
||||
<div class=${this._computeMessageClasses(message)}>
|
||||
@ -261,11 +236,6 @@ export class HaVoiceCommandDialog extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
private _completeOnboarding() {
|
||||
setConversationOnboarding(this.hass, true);
|
||||
this._agentInfo! = { ...this._agentInfo, onboarding: undefined };
|
||||
}
|
||||
|
||||
private _initRecognition() {
|
||||
this.recognition = new SpeechRecognition();
|
||||
this.recognition.interimResults = true;
|
||||
@ -443,9 +413,6 @@ export class HaVoiceCommandDialog extends LitElement {
|
||||
a.button > mwc-button {
|
||||
width: 100%;
|
||||
}
|
||||
.onboarding {
|
||||
border-bottom: 1px solid var(--divider-color);
|
||||
}
|
||||
.side-by-side {
|
||||
display: flex;
|
||||
margin: 8px 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user