Skip to content

Commit a1fe9c8

Browse files
committed
fix month and year graph
1 parent 33659b8 commit a1fe9c8

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

packages/modules/web_themes/colors/source/src/components/powerGraph/model.ts

+3
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ export function updateEnergyValues(
324324
})
325325
historicSummary.setEnergy('devices', 0)
326326
Object.entries(totals.sh).forEach(([id, values]) => {
327+
if (!historicSummary.keys().includes(id)) {
328+
historicSummary.addItem(id)
329+
}
327330
historicSummary.setEnergy(id, values.imported)
328331
const idNumber = id.substring(2)
329332
if (!shDevices[+idNumber].countAsHouse) {

packages/modules/web_themes/colors/source/src/components/powerGraph/processMonthYearGraphData.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,11 @@ function transformRow(inputRow: RawDayGraphDataItem): GraphDataItem {
155155
// Devices
156156
outputRow.devices = Object.entries(inputRow.sh).reduce<number>(
157157
(sum: number, item) => {
158+
if (!historicSummary.keys().includes(item[0])) {
159+
historicSummary.addItem(item[0])
160+
}
158161
if (item[1].energy_imported >= 0) {
159162
sum += item[1].energy_imported
160-
if (!historicSummary.keys().includes(item[0])) {
161-
historicSummary.addItem(item[0])
162-
}
163163
} else {
164164
console.warn(
165165
`Negative energy value for device ${item[0]} in row ${outputRow.date}. Ignoring this value`,

packages/modules/web_themes/colors/web/assets/index-4e3f10be.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/modules/web_themes/colors/web/assets/index-ec47239b.js

-2
This file was deleted.

packages/modules/web_themes/colors/web/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<link rel="apple-touch-icon" sizes="57x57" href="/openWB/web/img/favicons/apple-touch-icon-57x57.png">
2424
<link rel="apple-touch-icon" sizes="60x60" href="/openWB/web/img/favicons/apple-touch-icon-60x60.png">
2525
<title>openWB</title>
26-
<script type="module" crossorigin src="/openWB/web/themes/colors/assets/index-ec47239b.js"></script>
26+
<script type="module" crossorigin src="/openWB/web/themes/colors/assets/index-4e3f10be.js"></script>
2727
<link rel="modulepreload" crossorigin href="/openWB/web/themes/colors/assets/vendor-4d91b42b.js">
2828
<link rel="stylesheet" href="/openWB/web/themes/colors/assets/index-8951a584.css">
2929
</head>

0 commit comments

Comments
 (0)