Skip to content

Commit

Permalink
fix remaining state #2
Browse files Browse the repository at this point in the history
  • Loading branch information
MindFreeze committed May 25, 2022
1 parent 790fe7a commit b9b590a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ha-sankey-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,14 @@ export class SankeyChart extends LitElement {
})
.map(entityConf => {
const entity = this._getEntityState(entityConf);
const {state, unit_of_measurement} = this._normalizeStateValue(
entityConf.accountedState ? Number(entity.state) - entityConf.accountedState : Number(entity.state),
// eslint-disable-next-line prefer-const
let {state, unit_of_measurement} = this._normalizeStateValue(
Number(entity.state),
entity.attributes.unit_of_measurement
);
if (entityConf.accountedState) {
state -= entityConf.accountedState
}
total += state;
if (extraEntities[sectionIndex]) {
extraEntities[sectionIndex].some(e => {
Expand Down

0 comments on commit b9b590a

Please sign in to comment.