mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +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
|
||||
.hass="${this.hass}"
|
||||
.disabled="${!google_enabled}"
|
||||
@hass-api-called=${this._syncEntitiesCalled}
|
||||
path="cloud/google_actions/sync"
|
||||
>
|
||||
${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) {
|
||||
const toggle = ev.target as HaSwitch;
|
||||
try {
|
||||
|
@ -1164,6 +1164,7 @@
|
||||
"devices_pin": "Security Devices Pin",
|
||||
"enter_pin_hint": "Enter a PIN to use security devices",
|
||||
"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",
|
||||
"enter_pin_error": "Unable to store pin:"
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user