When munging statistics to history, assume always numeric (#20544)

This commit is contained in:
karwosts 2024-04-22 00:41:12 -07:00 committed by GitHub
parent 4b593c1c96
commit b5277dee53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -422,7 +422,8 @@ export const computeHistory = (
entityIds: string[], entityIds: string[],
localize: LocalizeFunc, localize: LocalizeFunc,
sensorNumericalDeviceClasses: string[], sensorNumericalDeviceClasses: string[],
splitDeviceClasses = false splitDeviceClasses = false,
forceNumeric = false
): HistoryResult => { ): HistoryResult => {
const lineChartDevices: { [unit: string]: HistoryStates } = {}; const lineChartDevices: { [unit: string]: HistoryStates } = {};
const timelineDevices: TimelineEntity[] = []; const timelineDevices: TimelineEntity[] = [];
@ -468,6 +469,7 @@ export const computeHistory = (
let unit: string | undefined; let unit: string | undefined;
const isNumeric = const isNumeric =
forceNumeric ||
isNumericFromDomain(domain) || isNumericFromDomain(domain) ||
(currentState != null && (currentState != null &&
isNumericFromAttributes(currentState.attributes)) || isNumericFromAttributes(currentState.attributes)) ||

View File

@ -421,6 +421,7 @@ class HaPanelHistory extends LitElement {
[], [],
this.hass.localize, this.hass.localize,
sensorNumericDeviceClasses, sensorNumericDeviceClasses,
true,
true true
); );
// remap states array to statistics array // remap states array to statistics array