-
Powerwall: {{batteryService.total}} V
+ Powerwall: {{batteryService.total | round}} V
diff --git a/src/app/battery/battery.service.ts b/src/app/battery/battery.service.ts
index 11df0fe..789b85c 100644
--- a/src/app/battery/battery.service.ts
+++ b/src/app/battery/battery.service.ts
@@ -57,6 +57,12 @@ export class BatteryService {
}
});
+ this.batteries.map((battery, i, arr) => {
+ if(i % 2 == 1) return battery;
+ console.log(i, battery.charge);
+ battery.charge = battery.charge - arr[i + 1].charge;
+ });
+
this.total = this.batteries.reduce((acc, battery) => acc + battery.charge, 0) / 2;
console.log(this.batteries)