mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +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 {
|
export interface AgentInfo {
|
||||||
attribution?: { name: string; url: string };
|
attribution?: { name: string; url: string };
|
||||||
onboarding?: { text: string; url: string };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const processConversationInput = (
|
export const processConversationInput = (
|
||||||
@ -76,15 +75,6 @@ export const getAgentInfo = (hass: HomeAssistant): Promise<AgentInfo> =>
|
|||||||
type: "conversation/agent/info",
|
type: "conversation/agent/info",
|
||||||
});
|
});
|
||||||
|
|
||||||
export const setConversationOnboarding = (
|
|
||||||
hass: HomeAssistant,
|
|
||||||
value: boolean
|
|
||||||
): Promise<boolean> =>
|
|
||||||
hass.callWS({
|
|
||||||
type: "conversation/onboarding/set",
|
|
||||||
shown: value,
|
|
||||||
});
|
|
||||||
|
|
||||||
export const prepareConversation = (
|
export const prepareConversation = (
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
language?: string
|
language?: string
|
||||||
|
@ -24,7 +24,6 @@ import {
|
|||||||
getAgentInfo,
|
getAgentInfo,
|
||||||
prepareConversation,
|
prepareConversation,
|
||||||
processConversationInput,
|
processConversationInput,
|
||||||
setConversationOnboarding,
|
|
||||||
} from "../../data/conversation";
|
} from "../../data/conversation";
|
||||||
import { haStyleDialog } from "../../resources/styles";
|
import { haStyleDialog } from "../../resources/styles";
|
||||||
import type { HomeAssistant } from "../../types";
|
import type { HomeAssistant } from "../../types";
|
||||||
@ -107,30 +106,6 @@ export class HaVoiceCommandDialog extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
<div class="messages">
|
<div class="messages">
|
||||||
<div class="messages-container" id="scroll-container">
|
<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(
|
${this._conversation.map(
|
||||||
(message) => html`
|
(message) => html`
|
||||||
<div class=${this._computeMessageClasses(message)}>
|
<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() {
|
private _initRecognition() {
|
||||||
this.recognition = new SpeechRecognition();
|
this.recognition = new SpeechRecognition();
|
||||||
this.recognition.interimResults = true;
|
this.recognition.interimResults = true;
|
||||||
@ -443,9 +413,6 @@ export class HaVoiceCommandDialog extends LitElement {
|
|||||||
a.button > mwc-button {
|
a.button > mwc-button {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.onboarding {
|
|
||||||
border-bottom: 1px solid var(--divider-color);
|
|
||||||
}
|
|
||||||
.side-by-side {
|
.side-by-side {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin: 8px 0;
|
margin: 8px 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user