diff --git a/src/data/cloud.ts b/src/data/cloud.ts index 674d07b2af..502ec10cd5 100644 --- a/src/data/cloud.ts +++ b/src/data/cloud.ts @@ -17,18 +17,20 @@ export interface CertificateInformation { fingerprint: string; } +interface CloudPreferences { + google_enabled: boolean; + alexa_enabled: boolean; + google_secure_devices_pin: string | undefined; + cloudhooks: { [webhookId: string]: CloudWebhook }; +} + export type CloudStatusLoggedIn = CloudStatusBase & { email: string; google_entities: EntityFilter; google_domains: string[]; alexa_entities: EntityFilter; alexa_domains: string[]; - prefs: { - google_enabled: boolean; - alexa_enabled: boolean; - google_allow_unlock: boolean; - cloudhooks: { [webhookId: string]: CloudWebhook }; - }; + prefs: CloudPreferences; remote_domain: string | undefined; remote_connected: boolean; remote_certificate: undefined | CertificateInformation; @@ -78,9 +80,9 @@ export const fetchCloudSubscriptionInfo = (hass: HomeAssistant) => export const updateCloudPref = ( hass: HomeAssistant, prefs: { - google_enabled?: boolean; - alexa_enabled?: boolean; - google_allow_unlock?: boolean; + google_enabled?: CloudPreferences["google_enabled"]; + alexa_enabled?: CloudPreferences["alexa_enabled"]; + google_secure_devices_pin?: CloudPreferences["google_secure_devices_pin"]; } ) => hass.callWS({ diff --git a/src/panels/config/cloud/cloud-google-pref.ts b/src/panels/config/cloud/cloud-google-pref.ts index 6dc830d850..18753a83f6 100644 --- a/src/panels/config/cloud/cloud-google-pref.ts +++ b/src/panels/config/cloud/cloud-google-pref.ts @@ -17,6 +17,7 @@ import { fireEvent } from "../../../common/dom/fire_event"; import { HomeAssistant } from "../../../types"; import "./cloud-exposed-entities"; import { CloudStatusLoggedIn, updateCloudPref } from "../../../data/cloud"; +import { PaperInputElement } from "@polymer/paper-input/paper-input"; export class CloudGooglePref extends LitElement { public hass?: HomeAssistant; @@ -34,7 +35,10 @@ export class CloudGooglePref extends LitElement { return html``; } - const { google_enabled, google_allow_unlock } = this.cloudStatus.prefs; + const { + google_enabled, + google_secure_devices_pin, + } = this.cloudStatus.prefs; return html` @@ -71,13 +75,18 @@ export class CloudGooglePref extends LitElement { > ${google_enabled ? html` -
-
Allow unlocking locks
- +
+ Please enter a pin to interact with security devices. Security + devices are doors, garage doors and locks. You will be asked + to say/enter this pin when interacting with such devices via + Google Assistant. +

Exposed entities:

div { - flex: 1; + paper-input { + width: 200px; } `; }