fix ecomix

This commit is contained in:
Florian Bezannier
2021-01-05 14:40:39 +01:00
parent dd34eaa860
commit 4bae281a9d
+1 -1
View File
@@ -445,7 +445,7 @@ class MyPSACC:
"DESC limit 1", (vin,)).fetchone()
in_progress = stop_at is None
if in_progress:
co2_per_kw = Ecomix.get_co2_per_kw(start_at, stop_at, latitude, longitude)
co2_per_kw = Ecomix.get_co2_per_kw(start_at, charge_date, latitude, longitude)
kw = (level-start_level)/100*BATTERY_POWER
res = conn.execute("UPDATE battery set stop_at=?, end_level=?, co2=?, kw=? WHERE start_at=? and VIN=?",
(charge_date, level, co2_per_kw, kw, start_at, vin))