-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
10 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,7 @@ The `Vehicle` class extends `dict` and stores vehicle data returned by the Owner | |
| --- | --- | --- | | ||
| `api()` | Yes | performs an API call to named endpoint requiring vehicle_id with optional arguments | | ||
| `get_vehicle_summary()` | No | gets the state of the vehicle (online, asleep, offline) | | ||
| `available()` | No | checks whether the vehicle is online | | ||
| `available()` | No | checks if the vehicle is online based on cached data or refreshed status when aged out | | ||
| `sync_wake_up()` | No | wakes up and waits for the vehicle to come online | | ||
| `decode_option()` | No | lookup option code description (read from *option_codes.json*) | | ||
| `option_code_list()` <sup>1</sup> | No | lists known descriptions of the vehicle option codes | | ||
|
@@ -66,7 +66,7 @@ The `Vehicle` class extends `dict` and stores vehicle data returned by the Owner | |
| `get_charge_history()` | No | lists vehicle charging history data points | | ||
| `get_user()` | No | gets user account data | | ||
| `get_user_details()` | No | get user account details | | ||
| `mobile_enabled()` | Yes | checks if mobile access is enabled in the vehicle | | ||
| `mobile_enabled()` | Yes | checks if the Mobile Access setting is enabled in the car | | ||
| `compose_image()` <sup>2</sup> | No | composes a vehicle image based on vehicle option codes | | ||
| `dist_units()` | Yes | converts distance or speed units to GUI setting of the vehicle | | ||
| `temp_units()` | Yes | converts temperature units to GUI setting of the vehicle | | ||
|
@@ -115,6 +115,12 @@ with teslapy.Tesla('[email protected]') as tesla: | |
print(vehicles[0].get_vehicle_data()['vehicle_state']['car_version']) | ||
``` | ||
|
||
TeslaPy 2.4.0+ automatically calls `get_vehicle_data()` when a key is not found, allowing you to omit an initial `get_vehicle_data()` call: | ||
|
||
```python | ||
print(vehicles[0]['vehicle_state']['car_version']) | ||
``` | ||
|
||
### Authentication | ||
|
||
The `Tesla` class implements a pluggable authentication method. If you want to implement your own method to handle the SSO page and retrieve the redirected URL after authentication, you can pass a function as an argument to the constructor, that takes the authentication URL as an argument and returns the redirected URL. The `authenticator` argument is accessible as an attribute as well. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ universal = 1 | |
|
||
[metadata] | ||
name = TeslaPy | ||
version = 2.3.0 | ||
version = 2.4.0 | ||
author = Tim Dorssers | ||
author_email = [email protected] | ||
description = A Python module to use the Tesla Motors Owner API | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
# Author: Tim Dorssers | ||
|
||
__version__ = '2.3.0' | ||
__version__ = '2.4.0' | ||
|
||
import os | ||
import ast | ||
|