Skip to content

Commit

Permalink
Added method for #155
Browse files Browse the repository at this point in the history
  • Loading branch information
tdorssers committed Jan 27, 2024
1 parent 28f7dba commit e9d4612
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions teslapy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,13 @@ def get_charge_history(self):
""" Lists vehicle charging history data points """
return self.api('VEHICLE_CHARGE_HISTORY')['response']

def get_charge_history_v2(self):
""" Lists vehicle charging history data points """
url = 'https://ownership.tesla.com/mobile-app/charging/history'
return self.tesla.get(url, params={
'vin': self['vin'], 'deviceLanguage': 'en', 'deviceCountry': 'US',
'operationName': 'getChargingHistoryV2'})['data']

def mobile_enabled(self):
""" Checks if the Mobile Access setting is enabled in the car. Raises
HTTPError when vehicle is in service or not online. """
Expand Down

0 comments on commit e9d4612

Please sign in to comment.