Skip to content

Commit

Permalink
changed floatingpoint for alltime stats
Browse files Browse the repository at this point in the history
  • Loading branch information
NoBl committed Sep 8, 2023
1 parent e247ee7 commit c7092ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ class Senec extends utils.Adapter {
await this.doState(pfx + key + " (k"+ value.einheit + ")", Number((value.wert / 1000).toFixed(2)), "", "k" + value.einheit, false);
}
}
if (period == api_trans["THIS_YEAR"].dp) await this.insertAllTimeHistory(system, key, new Date(obj.aggregation.startzeitpunkt).getFullYear(), Number((value.wert).toFixed(2)), value.einheit);
if (period == api_trans["THIS_YEAR"].dp) await this.insertAllTimeHistory(system, key, new Date(obj.aggregation.startzeitpunkt).getFullYear(), Number((value.wert).toFixed(0)), value.einheit);
}
}
const autarky = Number((((obj.aggregation.stromerzeugung.wert - obj.aggregation.netzeinspeisung.wert - obj.aggregation.speicherbeladung.wert + obj.aggregation.speicherentnahme.wert) / obj.aggregation.stromverbrauch.wert) * 100).toFixed(2));
Expand Down Expand Up @@ -526,7 +526,7 @@ class Senec extends utils.Adapter {
if (kiloList.includes(einheit)) {
await this.doState(pfx + key, Number((sum / 1000).toFixed(0)), "", "k" + einheit, false);
} else {
await this.doState(pfx + key, Number(sum.toFixed(2)), "", einheit, false);
await this.doState(pfx + key, Number(sum.toFixed(0)), "", einheit, false);
}
}
const autarky = Number((((sums.stromerzeugung - sums.netzeinspeisung - sums.speicherbeladung + sums.speicherentnahme) / sums.stromverbrauch) * 100).toFixed(0));
Expand Down

0 comments on commit c7092ce

Please sign in to comment.