diff --git a/psa_car_controller/web/view/views.py b/psa_car_controller/web/view/views.py index abd3571e..8fa49c8c 100644 --- a/psa_car_controller/web/view/views.py +++ b/psa_car_controller/web/view/views.py @@ -1,4 +1,5 @@ import json +from datetime import datetime from typing import List from urllib.parse import parse_qs, urlparse @@ -92,7 +93,7 @@ def capture_diffs_in_battery_table(timestamp, data, data_previous): for changed_line in diff_data: if changed_line['column_name'] == 'price': conn = Database.get_db() - charge = Charge(changed_line['start_at']) + charge = Charge(datetime.utcfromtimestamp(changed_line['start_at']/1000)) charge.price = changed_line['current_value'] charge.vin = get_default_car().vin if not Database.set_chargings_price(conn, charge):