mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fix history redraw timer (#16472)
This commit is contained in:
parent
ec36d4a381
commit
0be5aa108c
@ -360,7 +360,7 @@ class HaPanelHistory extends SubscribeMixin(LitElement) {
|
|||||||
clearInterval(this._interval);
|
clearInterval(this._interval);
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const end = this._endDate > now ? now : this._endDate;
|
const end = this._endDate > now ? now : this._endDate;
|
||||||
const timespan = differenceInHours(this._startDate, end);
|
const timespan = differenceInHours(end, this._startDate);
|
||||||
this._interval = window.setInterval(
|
this._interval = window.setInterval(
|
||||||
() => this._stateHistoryCharts?.requestUpdate(),
|
() => this._stateHistoryCharts?.requestUpdate(),
|
||||||
// if timespan smaller than 1 hour, update every 10 seconds, smaller than 5 hours, redraw every minute, otherwise every 5 minutes
|
// if timespan smaller than 1 hour, update every 10 seconds, smaller than 5 hours, redraw every minute, otherwise every 5 minutes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user