From 19c13096dc2a26c309a002dcb09f49d64f7944ec Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 1 Jun 2020 16:07:06 +0200 Subject: [PATCH] Fix map history (#6075) --- src/data/history.ts | 7 +++++-- src/panels/lovelace/cards/hui-map-card.ts | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/data/history.ts b/src/data/history.ts index ee244a2e7b..39c383659d 100644 --- a/src/data/history.ts +++ b/src/data/history.ts @@ -56,7 +56,8 @@ export const fetchRecent = ( startTime, endTime, skipInitialState = false, - significantChangesOnly?: boolean + significantChangesOnly?: boolean, + minimalResponse = true ): Promise => { let url = "history/period"; if (startTime) { @@ -72,7 +73,9 @@ export const fetchRecent = ( if (significantChangesOnly !== undefined) { url += `&significant_changes_only=${Number(significantChangesOnly)}`; } - url += "&minimal_response"; + if (minimalResponse) { + url += "&minimal_response"; + } return hass.callApi("GET", url); }; diff --git a/src/panels/lovelace/cards/hui-map-card.ts b/src/panels/lovelace/cards/hui-map-card.ts index de7bd3a434..97fd04a1c8 100644 --- a/src/panels/lovelace/cards/hui-map-card.ts +++ b/src/panels/lovelace/cards/hui-map-card.ts @@ -581,6 +581,7 @@ class HuiMapCard extends LitElement implements LovelaceCard { startTime.setHours(endTime.getHours() - this._config!.hours_to_show!); const skipInitialState = false; const significantChangesOnly = false; + const minimalResponse = false; const stateHistory = await fetchRecent( this.hass, @@ -588,7 +589,8 @@ class HuiMapCard extends LitElement implements LovelaceCard { startTime, endTime, skipInitialState, - significantChangesOnly + significantChangesOnly, + minimalResponse ); if (stateHistory.length < 1) {