Missed the entities in the editors (#6443)

This commit is contained in:
Bram Kragten 2020-07-22 14:16:25 +02:00 committed by GitHub
parent 8c8673a272
commit f6fb2e4b1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 27 additions and 12 deletions

View File

@ -61,6 +61,8 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard {
private _interval?: number;
private _fetching = false;
public getCardSize(): number {
return 4;
}
@ -138,6 +140,7 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard {
>
<state-history-charts
.hass=${this.hass}
.isLoadingData=${!this._stateHistory}
.historyData=${this._stateHistory}
.names=${this._names}
.upToNow=${true}
@ -149,13 +152,21 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard {
}
private async _getStateHistory(): Promise<void> {
this._stateHistory = await getRecentWithCache(
this.hass!,
this._cacheConfig!.cacheKey,
this._cacheConfig!,
this.hass!.localize,
this.hass!.language
);
if (this._fetching) {
return;
}
this._fetching = true;
try {
this._stateHistory = await getRecentWithCache(
this.hass!,
this._cacheConfig!.cacheKey,
this._cacheConfig!,
this.hass!.localize,
this.hass!.language
);
} finally {
this._fetching = false;
}
}
private _clearInterval(): void {

View File

@ -135,7 +135,8 @@ export class HuiEntitiesCardEditor extends LitElement
}
if (ev.detail && ev.detail.entities) {
this._config.entities = ev.detail.entities;
this._config = { ...this._config, entities: ev.detail.entities };
this._configEntities = processEditorEntities(this._config.entities);
} else if (target.configValue) {
if (target.value === "") {

View File

@ -193,7 +193,8 @@ export class HuiGlanceCardEditor extends LitElement
return;
}
if (ev.detail && ev.detail.entities) {
this._config.entities = ev.detail.entities;
this._config = { ...this._config, entities: ev.detail.entities };
this._configEntities = processEditorEntities(this._config.entities);
} else if (target.configValue) {
if (

View File

@ -136,7 +136,7 @@ export class HuiHistoryGraphCardEditor extends LitElement
}
if (ev.detail && ev.detail.entities) {
this._config.entities = ev.detail.entities;
this._config = { ...this._config, entities: ev.detail.entities };
this._configEntities = processEditorEntities(this._config.entities);
} else if (target.configValue) {
if (target.value === "") {

View File

@ -184,7 +184,8 @@ export class HuiMapCardEditor extends LitElement implements LovelaceCardEditor {
return;
}
if (ev.detail && ev.detail.entities) {
this._config.entities = ev.detail.entities;
this._config = { ...this._config, entities: ev.detail.entities };
this._configEntities = processEditorEntities(this._config.entities);
fireEvent(this, "config-changed", { config: this._config });
}

View File

@ -251,7 +251,8 @@ export class HuiPictureGlanceCardEditor extends LitElement
}
if (ev.detail && ev.detail.entities) {
this._config.entities = ev.detail.entities;
this._config = { ...this._config, entities: ev.detail.entities };
this._configEntities = processEditorEntities(this._config.entities);
} else if (target.configValue) {
if (