From cee1e66d17ee706246ebecdfe63e385217b6576c Mon Sep 17 00:00:00 2001 From: jlayec Date: Sat, 1 May 2021 22:40:11 +0000 Subject: [PATCH] fix get_position --- my_psacc.py | 3 ++- web/views.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/my_psacc.py b/my_psacc.py index 22d9fd9..a53e35a 100644 --- a/my_psacc.py +++ b/my_psacc.py @@ -476,7 +476,8 @@ class MyPSACC: try: charging_status = car.status.get_energy('Electric').charging.status charging_mode = car.status.get_energy('Electric').charging.charging_mode - Charging.record_charging(car, charging_status, charge_date, level, latitude, longitude, self.country_code, charging_mode) + Charging.record_charging(car, charging_status, charge_date, level, latitude, longitude, self.country_code, + charging_mode) logger.debug("charging_status:%s ", charging_status) except AttributeError: logger.error("charging status not available from api") diff --git a/web/views.py b/web/views.py index 74d64b0..daf677e 100644 --- a/web/views.py +++ b/web/views.py @@ -186,7 +186,7 @@ def get_position(vin): coordinates = res.last_position.geometry.coordinates except AttributeError: return jsonify({'error': 'last_position not available from api'}) - longitude, latitude, altitude = coordinates[:2] + longitude, latitude = coordinates[:2] if len(coordinates) == 3: # altitude is not always available altitude = coordinates[2] else: