mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-26 10:17:18 +00:00
WHIP handle hybrid car
This commit is contained in:
+2
-6
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user