mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 03:36:44 +00:00
Add alert when Google sync failed (#4435)
This commit is contained in:
parent
2eb548bb74
commit
79058e893b
@ -120,6 +120,7 @@ export class CloudGooglePref extends LitElement {
|
|||||||
<ha-call-api-button
|
<ha-call-api-button
|
||||||
.hass="${this.hass}"
|
.hass="${this.hass}"
|
||||||
.disabled="${!google_enabled}"
|
.disabled="${!google_enabled}"
|
||||||
|
@hass-api-called=${this._syncEntitiesCalled}
|
||||||
path="cloud/google_actions/sync"
|
path="cloud/google_actions/sync"
|
||||||
>
|
>
|
||||||
${this.hass!.localize(
|
${this.hass!.localize(
|
||||||
@ -139,6 +140,16 @@ export class CloudGooglePref extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _syncEntitiesCalled(ev: CustomEvent) {
|
||||||
|
if (!ev.detail.success && ev.detail.response.status_code === 404) {
|
||||||
|
alert(
|
||||||
|
this.hass!.localize(
|
||||||
|
"ui.panel.config.cloud.account.google.sync_entities_404_message"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async _enableToggleChanged(ev) {
|
private async _enableToggleChanged(ev) {
|
||||||
const toggle = ev.target as HaSwitch;
|
const toggle = ev.target as HaSwitch;
|
||||||
try {
|
try {
|
||||||
|
@ -1164,6 +1164,7 @@
|
|||||||
"devices_pin": "Security Devices Pin",
|
"devices_pin": "Security Devices Pin",
|
||||||
"enter_pin_hint": "Enter a PIN to use security devices",
|
"enter_pin_hint": "Enter a PIN to use security devices",
|
||||||
"sync_entities": "Sync Entities to Google",
|
"sync_entities": "Sync Entities to Google",
|
||||||
|
"sync_entities_404_message": "Failed to sync your entities to Google, ask Google 'Hey Google, sync my devices' to sync your entities.",
|
||||||
"manage_entities": "Manage Entities",
|
"manage_entities": "Manage Entities",
|
||||||
"enter_pin_error": "Unable to store pin:"
|
"enter_pin_error": "Unable to store pin:"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user