Force using history for all entity domains on map card (#15804)

This commit is contained in:
Paul Bottein 2023-03-13 11:52:27 +01:00 committed by GitHub
parent 1bc7bb0169
commit effb4b9f7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -232,7 +232,8 @@ export const subscribeHistoryStatesTimeWindow = (
hoursToShow: number,
entityIds: string[],
minimalResponse = true,
significantChangesOnly = true
significantChangesOnly = true,
noAttributes?: boolean
): Promise<() => Promise<void>> => {
const params = {
type: "history/stream",
@ -242,9 +243,11 @@ export const subscribeHistoryStatesTimeWindow = (
).toISOString(),
minimal_response: minimalResponse,
significant_changes_only: significantChangesOnly,
no_attributes: !entityIds.some((entityId) =>
entityIdHistoryNeedsAttributes(hass, entityId)
),
no_attributes:
noAttributes ??
!entityIds.some((entityId) =>
entityIdHistoryNeedsAttributes(hass, entityId)
),
};
const stream = new HistoryStream(hass, hoursToShow);
return hass.connection.subscribeMessage<HistoryStreamMessage>(

View File

@ -216,6 +216,7 @@ class HuiMapCard extends LitElement implements LovelaceCard {
this._config!.hours_to_show! ?? DEFAULT_HOURS_TO_SHOW,
this._configEntities!,
false,
false,
false
).catch((err) => {
this._subscribed = undefined;