mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-25 13:57:21 +00:00
Debounce refresh the cloud status if Google events happen (#11721)
This commit is contained in:
parent
5c5459bcaf
commit
9500ac498c
@ -12,6 +12,7 @@ import "../../../../components/buttons/ha-call-api-button";
|
|||||||
import "../../../../components/ha-card";
|
import "../../../../components/ha-card";
|
||||||
import "../../../../components/ha-button-menu";
|
import "../../../../components/ha-button-menu";
|
||||||
import "../../../../components/ha-icon-button";
|
import "../../../../components/ha-icon-button";
|
||||||
|
import { debounce } from "../../../../common/util/debounce";
|
||||||
import {
|
import {
|
||||||
cloudLogout,
|
cloudLogout,
|
||||||
CloudStatusLoggedIn,
|
CloudStatusLoggedIn,
|
||||||
@ -219,11 +220,15 @@ export class CloudAccount extends SubscribeMixin(LitElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override hassSubscribe() {
|
protected override hassSubscribe() {
|
||||||
const googleCheck = () => {
|
const googleCheck = debounce(
|
||||||
if (!this.cloudStatus?.google_registered) {
|
() => {
|
||||||
fireEvent(this, "ha-refresh-cloud-status");
|
if (this.cloudStatus && !this.cloudStatus.google_registered) {
|
||||||
}
|
fireEvent(this, "ha-refresh-cloud-status");
|
||||||
};
|
}
|
||||||
|
},
|
||||||
|
10000,
|
||||||
|
true
|
||||||
|
);
|
||||||
return [
|
return [
|
||||||
this.hass.connection.subscribeEvents(() => {
|
this.hass.connection.subscribeEvents(() => {
|
||||||
if (!this.cloudStatus?.alexa_registered) {
|
if (!this.cloudStatus?.alexa_registered) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user