mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-30 12:46:35 +00:00
Fix map history (#6075)
This commit is contained in:
parent
49b4271a47
commit
19c13096dc
@ -56,7 +56,8 @@ export const fetchRecent = (
|
||||
startTime,
|
||||
endTime,
|
||||
skipInitialState = false,
|
||||
significantChangesOnly?: boolean
|
||||
significantChangesOnly?: boolean,
|
||||
minimalResponse = true
|
||||
): Promise<HassEntity[][]> => {
|
||||
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);
|
||||
};
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user