mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
History data not updating (#385)
* History data not updating Fix history data not updating. History chart data will cache for 3 minutes. To reload, change the period dropdown to another value and change back. * remove history cache
This commit is contained in:
parent
0e687fb243
commit
c289f6c925
@ -3,7 +3,6 @@
|
||||
<script>
|
||||
(function () {
|
||||
var RECENT_THRESHOLD = 60000; // 1 minute
|
||||
var DATE_CACHE = {};
|
||||
var RECENT_CACHE = {};
|
||||
|
||||
function computeHistory(stateHistory) {
|
||||
@ -155,19 +154,17 @@
|
||||
|
||||
getDate: function (startTime, endTime) {
|
||||
var filter = startTime.toISOString() + '?end_time=' + endTime.toISOString();
|
||||
if (!DATE_CACHE[filter]) {
|
||||
DATE_CACHE[filter] = this.hass.callApi('GET', 'history/period/' + filter).then(
|
||||
function (stateHistory) {
|
||||
return computeHistory(stateHistory);
|
||||
},
|
||||
function () {
|
||||
DATE_CACHE[filter] = false;
|
||||
return null;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
return DATE_CACHE[filter];
|
||||
var prom = this.hass.callApi('GET', 'history/period/' + filter).then(
|
||||
function (stateHistory) {
|
||||
return computeHistory(stateHistory);
|
||||
},
|
||||
function () {
|
||||
return null;
|
||||
}
|
||||
);
|
||||
|
||||
return prom;
|
||||
},
|
||||
});
|
||||
}());
|
||||
|
Loading…
x
Reference in New Issue
Block a user