Skip to content

Commit

Permalink
Minor version incremented
Browse files Browse the repository at this point in the history
  • Loading branch information
tdorssers committed Jan 30, 2022
1 parent 6d7b68f commit bbb43f1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 |
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion teslapy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Author: Tim Dorssers

__version__ = '2.3.0'
__version__ = '2.4.0'

import os
import ast
Expand Down

0 comments on commit bbb43f1

Please sign in to comment.