diff --git a/public/static/icons/casita/loading.png b/public/static/icons/casita/loading.png deleted file mode 100644 index b2bcd76052..0000000000 Binary files a/public/static/icons/casita/loading.png and /dev/null differ diff --git a/public/static/icons/casita/loving.png b/public/static/icons/casita/loving.png deleted file mode 100644 index 5f1b518683..0000000000 Binary files a/public/static/icons/casita/loving.png and /dev/null differ diff --git a/public/static/icons/casita/normal.png b/public/static/icons/casita/normal.png deleted file mode 100644 index 0b72c54b99..0000000000 Binary files a/public/static/icons/casita/normal.png and /dev/null differ diff --git a/public/static/icons/casita/sad.png b/public/static/icons/casita/sad.png deleted file mode 100644 index d97183685e..0000000000 Binary files a/public/static/icons/casita/sad.png and /dev/null differ diff --git a/public/static/icons/casita/sleeping.png b/public/static/icons/casita/sleeping.png deleted file mode 100644 index 957a10b6e3..0000000000 Binary files a/public/static/icons/casita/sleeping.png and /dev/null differ diff --git a/public/static/icons/casita/smiling.png b/public/static/icons/casita/smiling.png deleted file mode 100644 index 5fb4d94587..0000000000 Binary files a/public/static/icons/casita/smiling.png and /dev/null differ diff --git a/public/static/images/logo_nabu_casa_dark.png b/public/static/images/logo_nabu_casa_dark.png new file mode 100644 index 0000000000..f8a3b3b4b9 Binary files /dev/null and b/public/static/images/logo_nabu_casa_dark.png differ diff --git a/public/static/images/voice-assistant/area.gif b/public/static/images/voice-assistant/area.gif new file mode 100644 index 0000000000..6489693442 Binary files /dev/null and b/public/static/images/voice-assistant/area.gif differ diff --git a/public/static/images/voice-assistant/change-wake-word.gif b/public/static/images/voice-assistant/change-wake-word.gif new file mode 100644 index 0000000000..edfe089d23 Binary files /dev/null and b/public/static/images/voice-assistant/change-wake-word.gif differ diff --git a/public/static/images/voice-assistant/error.gif b/public/static/images/voice-assistant/error.gif new file mode 100644 index 0000000000..c0fa7ba9a0 Binary files /dev/null and b/public/static/images/voice-assistant/error.gif differ diff --git a/public/static/images/voice-assistant/heart.gif b/public/static/images/voice-assistant/heart.gif new file mode 100644 index 0000000000..d7b89e312b Binary files /dev/null and b/public/static/images/voice-assistant/heart.gif differ diff --git a/public/static/images/voice-assistant/hi.gif b/public/static/images/voice-assistant/hi.gif new file mode 100644 index 0000000000..769612c6bf Binary files /dev/null and b/public/static/images/voice-assistant/hi.gif differ diff --git a/public/static/images/voice-assistant/ok-nabu.gif b/public/static/images/voice-assistant/ok-nabu.gif new file mode 100644 index 0000000000..4666ba091e Binary files /dev/null and b/public/static/images/voice-assistant/ok-nabu.gif differ diff --git a/public/static/images/voice-assistant/sleep.gif b/public/static/images/voice-assistant/sleep.gif new file mode 100644 index 0000000000..73181dea9d Binary files /dev/null and b/public/static/images/voice-assistant/sleep.gif differ diff --git a/public/static/images/voice-assistant/update.gif b/public/static/images/voice-assistant/update.gif new file mode 100644 index 0000000000..83b14cf9e6 Binary files /dev/null and b/public/static/images/voice-assistant/update.gif differ diff --git a/src/dialogs/voice-assistant-setup/styles.ts b/src/dialogs/voice-assistant-setup/styles.ts index d7b12d52a6..5d71a9446f 100644 --- a/src/dialogs/voice-assistant-setup/styles.ts +++ b/src/dialogs/voice-assistant-setup/styles.ts @@ -39,6 +39,9 @@ export const AssistantSetupStyles = [ .footer.full-width ha-button { width: 100%; } + .footer.centered { + justify-content: center; + } .footer.side-by-side { justify-content: space-between; } diff --git a/src/dialogs/voice-assistant-setup/voice-assistant-setup-dialog.ts b/src/dialogs/voice-assistant-setup/voice-assistant-setup-dialog.ts index 2e79b4bd49..858dc0d239 100644 --- a/src/dialogs/voice-assistant-setup/voice-assistant-setup-dialog.ts +++ b/src/dialogs/voice-assistant-setup/voice-assistant-setup-dialog.ts @@ -14,7 +14,6 @@ import { EntityRegistryDisplayEntry } from "../../data/entity_registry"; import { haStyleDialog } from "../../resources/styles"; import type { HomeAssistant } from "../../types"; import { VoiceAssistantSetupDialogParams } from "./show-voice-assistant-setup-dialog"; -import "./voice-assistant-setup-step-addons"; import "./voice-assistant-setup-step-area"; import "./voice-assistant-setup-step-change-wake-word"; import "./voice-assistant-setup-step-check"; @@ -34,7 +33,6 @@ export const enum STEP { PIPELINE, SUCCESS, CLOUD, - ADDONS, CHANGE_WAKEWORD, } @@ -210,22 +208,18 @@ export class HaVoiceAssistantSetupDialog extends LitElement { ? html`` - : this._step === STEP.ADDONS - ? html`` - : this._step === STEP.SUCCESS - ? html`` - : nothing} + .assistConfiguration=${this + ._assistConfiguration} + .assistEntityId=${this._findDomainEntityId( + this._params.deviceId, + this.hass.entities, + "assist_satellite" + )} + >` + : nothing} `; diff --git a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-addons.ts b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-addons.ts deleted file mode 100644 index e79f7f3574..0000000000 --- a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-addons.ts +++ /dev/null @@ -1,185 +0,0 @@ -import { css, html, LitElement, nothing, PropertyValues } from "lit"; -import { customElement, property, state } from "lit/decorators"; -import { fireEvent } from "../../common/dom/fire_event"; -import { HomeAssistant } from "../../types"; -import { AssistantSetupStyles } from "./styles"; -import { STEP } from "./voice-assistant-setup-dialog"; -import { documentationUrl } from "../../util/documentation-url"; - -@customElement("ha-voice-assistant-setup-step-addons") -export class HaVoiceAssistantSetupStepAddons extends LitElement { - @property({ attribute: false }) public hass!: HomeAssistant; - - @state() private _showFirst = false; - - @state() private _showSecond = false; - - @state() private _showThird = false; - - @state() private _showFourth = false; - - protected override firstUpdated(changedProperties: PropertyValues) { - super.firstUpdated(changedProperties); - setTimeout(() => { - this._showFirst = true; - }, 200); - setTimeout(() => { - this._showSecond = true; - }, 600); - setTimeout(() => { - this._showThird = true; - }, 3000); - setTimeout(() => { - this._showFourth = true; - }, 8000); - } - - protected override render() { - return html`
-

Local

-

- Are you sure you want to use the local voice assistant? It requires a - powerful device to run. If you device is not powerful enough, Home - Assistant cloud might be a better option. -

-

Raspberry Pi 4

-
-
- ${!this._showThird ? "…" : "Turn on the lights in the bedroom"} -
- ${this._showThird - ? html`
3 seconds
` - : nothing} - ${this._showThird - ? html`
- ${!this._showFourth ? "…" : "Turned on the lights"} -
` - : nothing} - ${this._showFourth - ? html`
5 seconds
` - : nothing} -
-

Home Assistant Cloud

-
-
- ${!this._showFirst ? "…" : "Turn on the lights in the bedroom"} -
- ${this._showFirst - ? html`
0.2 seconds
` - : nothing} - ${this._showFirst - ? html`
- ${!this._showSecond ? "…" : "Turned on the lights"} -
` - : nothing} - ${this._showSecond - ? html`
0.4 seconds
` - : nothing} -
-
- `; - } - - private _goToCloud() { - fireEvent(this, "next-step", { step: STEP.CLOUD }); - } - - private _skip() { - fireEvent(this, "next-step", { step: STEP.SUCCESS }); - } - - static styles = [ - AssistantSetupStyles, - css` - .messages-container { - padding: 24px; - box-sizing: border-box; - height: 195px; - background: var(--input-fill-color); - border-radius: 16px; - border: 1px solid var(--divider-color); - display: flex; - flex-direction: column; - } - .message { - white-space: nowrap; - font-size: 18px; - clear: both; - margin: 8px 0; - padding: 8px; - border-radius: 15px; - height: 36px; - box-sizing: border-box; - overflow: hidden; - text-overflow: ellipsis; - width: 30px; - } - .rpi .message { - transition: width 1s; - } - .cloud .message { - transition: width 0.5s; - } - - .message.user { - margin-left: 24px; - margin-inline-start: 24px; - margin-inline-end: initial; - align-self: self-end; - text-align: right; - border-bottom-right-radius: 0px; - background-color: var(--primary-color); - color: var(--text-primary-color); - direction: var(--direction); - } - .timing.user { - align-self: self-end; - } - - .message.user.show { - width: 295px; - } - - .message.hass { - margin-right: 24px; - margin-inline-end: 24px; - margin-inline-start: initial; - align-self: self-start; - border-bottom-left-radius: 0px; - background-color: var(--secondary-background-color); - color: var(--primary-text-color); - direction: var(--direction); - } - .timing.hass { - align-self: self-start; - } - - .message.hass.show { - width: 184px; - } - .footer { - margin-top: 24px; - } - `, - ]; -} - -declare global { - interface HTMLElementTagNameMap { - "ha-voice-assistant-setup-step-addons": HaVoiceAssistantSetupStepAddons; - } -} diff --git a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-area.ts b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-area.ts index d1db3fdd7a..0da28dfeea 100644 --- a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-area.ts +++ b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-area.ts @@ -16,7 +16,7 @@ export class HaVoiceAssistantSetupStepArea extends LitElement { const device = this.hass.devices[this.deviceId]; return html`
- +

Select area

When you voice assistant knows where it is, it can better control the diff --git a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-change-wake-word.ts b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-change-wake-word.ts index 1f6e8740e2..1c798b53b1 100644 --- a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-change-wake-word.ts +++ b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-change-wake-word.ts @@ -10,6 +10,7 @@ import { STEP } from "./voice-assistant-setup-dialog"; import { AssistantSetupStyles } from "./styles"; import "../../components/ha-md-list"; import "../../components/ha-md-list-item"; +import { formatLanguageCode } from "../../common/language/format_language"; @customElement("ha-voice-assistant-setup-step-change-wake-word") export class HaVoiceAssistantSetupStepChangeWakeWord extends LitElement { @@ -22,11 +23,12 @@ export class HaVoiceAssistantSetupStepChangeWakeWord extends LitElement { protected override render() { return html`

- +

Change wake word

- Some wake words are better for [your language] and voice than others. - Please try them out. + Some wake words are better for + ${formatLanguageCode(this.hass.locale.language, this.hass.locale)} and + voice than others. Please try them out.

diff --git a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-check.ts b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-check.ts index 0ce0fa9b86..d3fa0aa815 100644 --- a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-check.ts +++ b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-check.ts @@ -1,4 +1,4 @@ -import { html, LitElement, PropertyValues } from "lit"; +import { html, LitElement, nothing, PropertyValues } from "lit"; import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import { testAssistSatelliteConnection } from "../../data/assist_satellite"; @@ -13,6 +13,8 @@ export class HaVoiceAssistantSetupStepCheck extends LitElement { @state() private _status?: "success" | "timeout"; + @state() private _showLoader = false; + protected override willUpdate(changedProperties: PropertyValues): void { super.willUpdate(changedProperties); if (!this.hasUpdated) { @@ -30,39 +32,48 @@ export class HaVoiceAssistantSetupStepCheck extends LitElement { protected override render() { return html`
- ${this._status === "success" - ? html` + ${this._status === "timeout" + ? html` +

The voice assistant is unable to connect to Home Assistant

+

+ To play audio, the voice assistant device has to connect to Home + Assistant to fetch the files. Our test shows that the device is + unable to reach the Home Assistant server. +

+ ` + : html`

Hi

- With a couple of steps we are going to setup your voice assistant. -

` - : this._status === "timeout" - ? html` -

Voice assistant can not connect to Home Assistant

-

- A good explanation what is happening and what action you should - take. -

- ` - : html` -

Checking...

-

- We are checking if the device can reach your Home Assistant - instance. -

- `} + Over the next couple steps we're going to personalize your voice + assistant. +

+ + ${this._showLoader + ? html`` + : nothing} `}
`; } private async _testConnection() { this._status = undefined; + this._showLoader = false; + const timeout = setTimeout(() => { + this._showLoader = true; + }, 3000); const result = await testAssistSatelliteConnection( this.hass, this.assistEntityId! ); + clearTimeout(timeout); + this._showLoader = false; this._status = result.status; } diff --git a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-cloud.ts b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-cloud.ts index 72aec24ca2..18962da257 100644 --- a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-cloud.ts +++ b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-cloud.ts @@ -1,7 +1,9 @@ -import { html, LitElement } from "lit"; +import { mdiEarth, mdiMicrophoneMessage, mdiOpenInNew } from "@mdi/js"; +import { css, html, LitElement } from "lit"; import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import { HomeAssistant } from "../../types"; +import { brandsUrl } from "../../util/brands-url"; import { AssistantSetupStyles } from "./styles"; @customElement("ha-voice-assistant-setup-step-cloud") @@ -10,22 +12,92 @@ export class HaVoiceAssistantSetupStepCloud extends LitElement { protected override render() { return html`
- -

Supercharge your assistant with Home Assistant Cloud

-

- Speed up and take the load off your system by running your - text-to-speech and speech-to-text in our private and secure cloud. - Cloud also includes secure remote access to your system while - supporting the development of Home Assistant. -

+ Nabu Casa logo +

The power of Home Assistant Cloud

+
+
+
+
+ +
+
+

+ ${this.hass.localize( + "ui.panel.config.voice_assistants.assistants.cloud.features.speech.title" + )} + +

+

+ ${this.hass.localize( + "ui.panel.config.voice_assistants.assistants.cloud.features.speech.text" + )} +

+
+
+
+
+ +
+
+

+ Remote access + +

+

+ Secure remote access to your system while supporting the + development of Home Assistant. +

+
+
+
+ Google Assistant + Amazon Alexa +
+

+ ${this.hass.localize( + "ui.panel.config.voice_assistants.assistants.cloud.features.assistants.title" + )} +

+

+ ${this.hass.localize( + "ui.panel.config.voice_assistants.assistants.cloud.features.assistants.text" + )} +

+
+