Skip to content

Commit

Permalink
Add recall status
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian committed Jan 9, 2022
1 parent 80a655e commit e34075d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions connectedcar/vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def __init__(self, vehicle_id, access_token, region="US"):
"""
self.access_token = access_token
self.vehicle_id = vehicle_id
self.region = region
self.api = Api(access_token, region)

def status(self):
Expand Down Expand Up @@ -136,6 +137,22 @@ def capability(self):
const.USER_URL, 'capability/v1/vehicles/' + self.vehicle_id)
return response.json()

def recall_status(self):
""" GET Vehicle.recall_status
Note: Currently only supported in US regions.
Returns:
Response: Vehicle recall status
Raises:
SyncException
"""

response = self.api.get(
const.USER_URL, 'recall/v2/recalls?vin='+self.vehicle_id+'&language=EN&region=US&country=USA')
return response.json()

def vin(self):
""" GET Vehicle.vin
Expand Down

0 comments on commit e34075d

Please sign in to comment.