Skip to content

Commit

Permalink
Merge pull request #653 from Mikado8231/fix-update-price
Browse files Browse the repository at this point in the history
fix: Update price #369
  • Loading branch information
flobz authored Nov 14, 2023
2 parents 56d96d5 + 19efb1f commit 89e677f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion psa_car_controller/web/view/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
from datetime import datetime
from typing import List
from urllib.parse import parse_qs, urlparse

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 89e677f

Please sign in to comment.