mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Fix statistics chart for sum stat without state (#12238)
This commit is contained in:
parent
aff1ec10bf
commit
1dba849567
@ -347,8 +347,8 @@ class StatisticsChart extends LitElement {
|
||||
statTypes.forEach((type) => {
|
||||
let val: number | null;
|
||||
if (type === "sum") {
|
||||
if (!initVal) {
|
||||
initVal = val = stat.state;
|
||||
if (initVal === null) {
|
||||
initVal = val = stat.state || 0;
|
||||
prevSum = stat.sum;
|
||||
} else {
|
||||
val = initVal + ((stat.sum || 0) - prevSum!);
|
||||
|
Loading…
x
Reference in New Issue
Block a user