WHIP handle hybrid car

This commit is contained in:
Florian Bezannier
2021-03-05 21:01:40 +01:00
parent 0a5f299c04
commit 3ebc48903a
6 changed files with 256 additions and 181 deletions
+2 -6
View File
@@ -10,6 +10,7 @@ from MyLogger import logger
from flask import jsonify, request, Response as FlaskResponse
from MyPSACC import MyPSACC
from Trip import Trips
from web import figures
from web.app import app, dash_app, myp, chc
@@ -114,16 +115,11 @@ def update_trips():
global trips, chargings
logger.info("update_data")
try:
if myp.vehicles_list == None: # mandatory for offline mode right now
trips = MyPSACC.get_trips()
else:
vehicle_model = list(myp.vehicles_list.values())[0]['label'] # workaround here as vin is not managed yet in the dashboard
trips = MyPSACC.get_trips(vehicle_model)
trips = Trips.get_trips(myp.vehicles_list)
chargings = MyPSACC.get_chargings()
except:
logger.error("update_trips: " + traceback.format_exc())
try:
web.db.callback_fct = update_trips
update_trips()