Skip to content

Commit e34075d

Browse files
author
Ian
committed
Add recall status
1 parent 80a655e commit e34075d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

connectedcar/vehicle.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def __init__(self, vehicle_id, access_token, region="US"):
1414
"""
1515
self.access_token = access_token
1616
self.vehicle_id = vehicle_id
17+
self.region = region
1718
self.api = Api(access_token, region)
1819

1920
def status(self):
@@ -136,6 +137,22 @@ def capability(self):
136137
const.USER_URL, 'capability/v1/vehicles/' + self.vehicle_id)
137138
return response.json()
138139

140+
def recall_status(self):
141+
""" GET Vehicle.recall_status
142+
Note: Currently only supported in US regions.
143+
144+
Returns:
145+
Response: Vehicle recall status
146+
147+
Raises:
148+
SyncException
149+
150+
"""
151+
152+
response = self.api.get(
153+
const.USER_URL, 'recall/v2/recalls?vin='+self.vehicle_id+'&language=EN&region=US&country=USA')
154+
return response.json()
155+
139156
def vin(self):
140157
""" GET Vehicle.vin
141158

0 commit comments

Comments
 (0)