mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-31 05:06:38 +00:00
Fix map history (#6075)
This commit is contained in:
parent
49b4271a47
commit
19c13096dc
@ -56,7 +56,8 @@ export const fetchRecent = (
|
|||||||
startTime,
|
startTime,
|
||||||
endTime,
|
endTime,
|
||||||
skipInitialState = false,
|
skipInitialState = false,
|
||||||
significantChangesOnly?: boolean
|
significantChangesOnly?: boolean,
|
||||||
|
minimalResponse = true
|
||||||
): Promise<HassEntity[][]> => {
|
): Promise<HassEntity[][]> => {
|
||||||
let url = "history/period";
|
let url = "history/period";
|
||||||
if (startTime) {
|
if (startTime) {
|
||||||
@ -72,7 +73,9 @@ export const fetchRecent = (
|
|||||||
if (significantChangesOnly !== undefined) {
|
if (significantChangesOnly !== undefined) {
|
||||||
url += `&significant_changes_only=${Number(significantChangesOnly)}`;
|
url += `&significant_changes_only=${Number(significantChangesOnly)}`;
|
||||||
}
|
}
|
||||||
url += "&minimal_response";
|
if (minimalResponse) {
|
||||||
|
url += "&minimal_response";
|
||||||
|
}
|
||||||
|
|
||||||
return hass.callApi("GET", url);
|
return hass.callApi("GET", url);
|
||||||
};
|
};
|
||||||
|
@ -581,6 +581,7 @@ class HuiMapCard extends LitElement implements LovelaceCard {
|
|||||||
startTime.setHours(endTime.getHours() - this._config!.hours_to_show!);
|
startTime.setHours(endTime.getHours() - this._config!.hours_to_show!);
|
||||||
const skipInitialState = false;
|
const skipInitialState = false;
|
||||||
const significantChangesOnly = false;
|
const significantChangesOnly = false;
|
||||||
|
const minimalResponse = false;
|
||||||
|
|
||||||
const stateHistory = await fetchRecent(
|
const stateHistory = await fetchRecent(
|
||||||
this.hass,
|
this.hass,
|
||||||
@ -588,7 +589,8 @@ class HuiMapCard extends LitElement implements LovelaceCard {
|
|||||||
startTime,
|
startTime,
|
||||||
endTime,
|
endTime,
|
||||||
skipInitialState,
|
skipInitialState,
|
||||||
significantChangesOnly
|
significantChangesOnly,
|
||||||
|
minimalResponse
|
||||||
);
|
);
|
||||||
|
|
||||||
if (stateHistory.length < 1) {
|
if (stateHistory.length < 1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user