mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 01:16:14 +00:00
fix get_position
This commit is contained in:
committed by
Florian BEZANNIER
parent
94e681d853
commit
cee1e66d17
+2
-1
@@ -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
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user