mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 09:26:16 +00:00
fix: bad data update date (#448)
pull request to fix #415 suggested by @lebetz, see: https://github.com/flobz/psa_car_controller/issues/415#issuecomment-1309203980
This commit is contained in:
@@ -187,7 +187,7 @@ class PSAClient:
|
||||
altitude = car.status.last_position.geometry.coordinates[2]
|
||||
date = car.status.last_position.properties.updated_at
|
||||
if date is None or date < datetime.now(timezone.utc) - timedelta(days=1): # if position isn't updated
|
||||
date = car.status.service.updated_at
|
||||
date = charge_date
|
||||
logger.debug("vin:%s longitude:%s latitude:%s date:%s mileage:%s level:%s charge_date:%s level_fuel:"
|
||||
"%s moving:%s", car.vin, longitude, latitude, date, mileage, level, charge_date, level_fuel,
|
||||
moving)
|
||||
|
||||
Reference in New Issue
Block a user