fix get_position

This commit is contained in:
jlayec
2021-05-01 22:40:11 +00:00
parent 916daecaf6
commit 2cf16c94a2
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -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")
+1 -1
View File
@@ -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: