diff --git a/src/data/cloud.ts b/src/data/cloud.ts index f153ea2041..0082c5ee35 100644 --- a/src/data/cloud.ts +++ b/src/data/cloud.ts @@ -3,8 +3,8 @@ import { PlaceholderContainer } from "../panels/config/automation/thingtalk/dial import { HomeAssistant } from "../types"; import { AutomationConfig } from "./automation"; -interface CloudStatusBase { - logged_in: boolean; +interface CloudStatusNotLoggedIn { + logged_in: false; cloud: "disconnected" | "connecting" | "connected"; } @@ -44,7 +44,9 @@ export interface CloudPreferences { tts_default_voice: [string, string]; } -export type CloudStatusLoggedIn = CloudStatusBase & { +export interface CloudStatusLoggedIn { + logged_in: true; + cloud: "disconnected" | "connecting" | "connected"; email: string; google_registered: boolean; google_entities: EntityFilter; @@ -54,9 +56,9 @@ export type CloudStatusLoggedIn = CloudStatusBase & { remote_domain: string | undefined; remote_connected: boolean; remote_certificate: undefined | CertificateInformation; -}; +} -export type CloudStatus = CloudStatusBase | CloudStatusLoggedIn; +export type CloudStatus = CloudStatusNotLoggedIn | CloudStatusLoggedIn; export interface SubscriptionInfo { human_description: string; diff --git a/src/panels/config/cloud/account/cloud-google-pref.ts b/src/panels/config/cloud/account/cloud-google-pref.ts index 08dc518b76..eb3d3cf6db 100644 --- a/src/panels/config/cloud/account/cloud-google-pref.ts +++ b/src/panels/config/cloud/account/cloud-google-pref.ts @@ -6,6 +6,7 @@ import { property } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/buttons/ha-call-api-button"; import "../../../../components/ha-card"; +import "../../../../components/ha-alert"; import type { HaSwitch } from "../../../../components/ha-switch"; import { CloudStatusLoggedIn, updateCloudPref } from "../../../../data/cloud"; import { showAlertDialog } from "../../../../dialogs/generic/show-dialog-box"; @@ -44,41 +45,40 @@ export class CloudGooglePref extends LitElement {

${google_enabled && !this.cloudStatus.google_registered ? html` -

- ${this.hass.localize( + -

+ > ${this.hass.localize( "ui.panel.config.cloud.account.google.not_configured_text" )} -

- + +
` : ""} ${google_enabled diff --git a/src/panels/config/cloud/account/cloud-remote-pref.ts b/src/panels/config/cloud/account/cloud-remote-pref.ts index f01070f887..dff93050bc 100644 --- a/src/panels/config/cloud/account/cloud-remote-pref.ts +++ b/src/panels/config/cloud/account/cloud-remote-pref.ts @@ -4,6 +4,7 @@ import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-card"; +import "../../../../components/ha-alert"; import "../../../../components/ha-switch"; // eslint-disable-next-line import type { HaSwitch } from "../../../../components/ha-switch"; @@ -53,18 +54,22 @@ export class CloudRemotePref extends LitElement { "ui.panel.config.cloud.account.remote.title" )} > -
- ${this.hass.localize( - `ui.panel.config.cloud.account.remote.${ - remote_connected - ? "connected" - : remote_enabled - ? "reconnecting" - : "not_connected" - }` - )} +
+
+ ${!remote_connected && remote_enabled + ? html` + + ` + : ""} ${this.hass.localize("ui.panel.config.cloud.account.remote.info")} ${this.hass.localize( `ui.panel.config.cloud.account.remote.${ @@ -81,25 +86,6 @@ export class CloudRemotePref extends LitElement { > https://${remote_domain}. - -
-

- ${this.hass.localize( - "ui.panel.config.cloud.account.remote.remote_enabled.caption" - )} -

-
- -
-
-

- ${this.hass.localize( - "ui.panel.config.cloud.account.remote.remote_enabled.description" - )} -