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

View File

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