diff --git a/src/main.js b/src/main.js index 43f806d..85bb78c 100644 --- a/src/main.js +++ b/src/main.js @@ -276,7 +276,9 @@ class MiniGraphCard extends LitElement { getEntityState(id) { const entityConfig = this.config.entities[id]; - if (this.config.show.state === 'last') { + if (this.config.show.state === 'sum') { + return this.points[id].reduce((sum, point) => sum + point[V], 0); + } else if (this.config.show.state === 'last') { return this.points[id][this.points[id].length - 1][V]; } else if (entityConfig.attribute) { return this.getObjectAttr(this.entity[id].attributes, entityConfig.attribute);