mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 19:56:42 +00:00
Update cloud-google-pref.ts (#3628)
This commit is contained in:
parent
460a56aa0a
commit
4eed3508ce
@ -18,6 +18,7 @@ import { fireEvent } from "../../../../common/dom/fire_event";
|
|||||||
import { HomeAssistant } from "../../../../types";
|
import { HomeAssistant } from "../../../../types";
|
||||||
import { CloudStatusLoggedIn, updateCloudPref } from "../../../../data/cloud";
|
import { CloudStatusLoggedIn, updateCloudPref } from "../../../../data/cloud";
|
||||||
import { PaperInputElement } from "@polymer/paper-input/paper-input";
|
import { PaperInputElement } from "@polymer/paper-input/paper-input";
|
||||||
|
import { showSaveSuccessToast } from "../../../../util/toast-saved-success";
|
||||||
|
|
||||||
export class CloudGooglePref extends LitElement {
|
export class CloudGooglePref extends LitElement {
|
||||||
public hass?: HomeAssistant;
|
public hass?: HomeAssistant;
|
||||||
@ -83,7 +84,7 @@ export class CloudGooglePref extends LitElement {
|
|||||||
<paper-input
|
<paper-input
|
||||||
label="Secure Devices Pin"
|
label="Secure Devices Pin"
|
||||||
id="google_secure_devices_pin"
|
id="google_secure_devices_pin"
|
||||||
placeholder="Secure devices disabled"
|
placeholder="Enter a PIN to use secure devices"
|
||||||
.value=${google_secure_devices_pin || ""}
|
.value=${google_secure_devices_pin || ""}
|
||||||
@change="${this._pinChanged}"
|
@change="${this._pinChanged}"
|
||||||
></paper-input>
|
></paper-input>
|
||||||
@ -124,6 +125,7 @@ export class CloudGooglePref extends LitElement {
|
|||||||
await updateCloudPref(this.hass!, {
|
await updateCloudPref(this.hass!, {
|
||||||
[input.id]: input.value || null,
|
[input.id]: input.value || null,
|
||||||
});
|
});
|
||||||
|
showSaveSuccessToast(this, this.hass!);
|
||||||
fireEvent(this, "ha-refresh-cloud-status");
|
fireEvent(this, "ha-refresh-cloud-status");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
alert(`Unable to store pin: ${err.message}`);
|
alert(`Unable to store pin: ${err.message}`);
|
||||||
@ -150,7 +152,7 @@ export class CloudGooglePref extends LitElement {
|
|||||||
padding-top: 16px;
|
padding-top: 16px;
|
||||||
}
|
}
|
||||||
paper-input {
|
paper-input {
|
||||||
width: 200px;
|
width: 250px;
|
||||||
}
|
}
|
||||||
.card-actions {
|
.card-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user