From e34075d1fd90f2ecd2c7247a1f3b7f50bd8f80fb Mon Sep 17 00:00:00 2001 From: Ian Date: Sun, 9 Jan 2022 01:32:10 -0600 Subject: [PATCH] Add recall status --- connectedcar/vehicle.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/connectedcar/vehicle.py b/connectedcar/vehicle.py index 841af9d..5773cba 100644 --- a/connectedcar/vehicle.py +++ b/connectedcar/vehicle.py @@ -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): @@ -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®ion=US&country=USA') + return response.json() + def vin(self): """ GET Vehicle.vin