Fix second visit to history panel (#1835)

This commit is contained in:
Paulus Schoutsen 2018-10-22 21:37:21 +02:00 committed by GitHub
parent c190f1986e
commit 4f8c8762c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -155,7 +155,7 @@ class HaStateHistoryData extends LocalizeMixin(PolymerElement) {
static get observers() {
return [
"filterChangedDebouncer(filterType, entityId, startTime, endTime, cacheConfig, localize, language)",
"filterChangedDebouncer(filterType, entityId, startTime, endTime, cacheConfig, localize)",
];
}
@ -167,8 +167,7 @@ class HaStateHistoryData extends LocalizeMixin(PolymerElement) {
this.startTime,
this.endTime,
this.cacheConfig,
this.localize,
this.hass.language
this.localize
);
}
@ -188,8 +187,7 @@ class HaStateHistoryData extends LocalizeMixin(PolymerElement) {
this.startTime,
this.endTime,
this.cacheConfig,
this.localize,
this.hass.language
this.localize
);
}
}
@ -210,13 +208,18 @@ class HaStateHistoryData extends LocalizeMixin(PolymerElement) {
startTime,
endTime,
cacheConfig,
localize,
language
localize
) {
if (!this.hass) return;
if (cacheConfig && !cacheConfig.cacheKey) return;
if (!localize || !language) return;
this._madeFirstCall = true;
if (!this.hass) {
return;
}
if (cacheConfig && !cacheConfig.cacheKey) {
return;
}
if (!localize) {
return;
}
const language = this.hass.language;
let data;
if (filterType === "date") {