mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
When munging statistics to history, assume always numeric (#20544)
This commit is contained in:
parent
4b593c1c96
commit
b5277dee53
@ -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)) ||
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user