-
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.
Separate getting full, selective and location data for vehicles (#153)
* Separate getting full, basic and location data Addresses changes in how vehicle location data is provided after late 2023 vehicle software updates. Retains get_vehicle_data() as the method to get all vehicle data to prevent breaking changes. Updates version to 2.10.0 as it the initial fix for the location changes didn't increment to 2.9.0 Adds two additional endpoints to teslapy/endpoints.json: VEHICLE_BASIC_DATA: gets only basic vehicle data. VEHICLE_LOCATION_DATA: basic vehicle_state and location_data. Updates VEHICLE_DATA to get all endpoints. Adds two methods to the Vehicle Class to use the new endpoints: get_vehicle_basic_data(): Get only basic vehicle data. get_vehicle_location_data(): Get basic vehicle data, and location data. Adds two new flags to CLI: -B --basic: Get only basic vehicle data -G --location: Get current location (GPS) data Updates readme. * Fix missing version update in setup.cfg * Revert endpoints, update __init__, set v=2.9.0 Implements feedback in original pull request: #153 (comment) Reverts endpoints.json to previous version for Android consistency: remove VEHICLE_BASIC_DATA remove VEHICLE_LOCATION_DATA Update __init__ to include endpoints in Vehicle Class methods - get_vehicle_data(): all endpoints - location_data, charge_state; climate_state, vehicle_state, gui_settings, vehicle_config. - get_vehicle_basic_data(): no extra endpints. - get_vehicle_location_data(): only location_data and basic data. Set version number to 2.9.0. * Get recent location data, cleanup endpoint requests Updates Vehicle Class: Removes get_vehicle_basic_data() Updates get_vehicle_data() to allow selection of individual endpoints, defaults to all endpoints. Updates get_vehicle_location_data(): - Adds optional location data max_age in seconds. Defaults to 300 (five minutes). - Updates and cleans up logic to prevent issues with missing data if it ages out in persistent connections. - Fix recursion error when vehicle was online but doesn't come back online for subsequent requests. Minor fixes: - Swaps most string formatting with fStrings, not panel ones since I can't test panel changes without a panel, and not the conversion ones since fStrings are less readable there. - Reflows lines over 80 chars, with same panel exception, most significantly in Vechicle.decode_vin() - Minor linting/spacing changes
- Loading branch information
Showing
4 changed files
with
107 additions
and
64 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
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
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.8.0 | ||
version = 2.9.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