Revision history for Tesla-API
1.02 2022-07-19
- Add uri(); Generates and returns a new URI object (to be inherited)
- Add uuid(); Each object now has its own cache. All cache data and related
mechanism attributes are confined and will not be modified by other
objects, whether in the same or separate process (closes #11)
1.01 2022-04-22
- Unit test suite now has 90% coverage
- _decode() is now an object method as opposed to a simple function
- _api_attempts() now resets on a false value, and we reset it at the
beginning of each call to _tesla_api_call()
- useragent_string() and useragent_timeout() now set a flag that the mech()
object needs to be re-instantiated, so changes are reflected in runtime
- _tesla_api_call() now returns a hashref with error and displays a warning
if all API_TIMEOUT_RETRIES get exhausted, instead of croaking
1.00 2022-04-19
- This version is now deemed stable; The user-facing API calls will now
remain consistent going forward
- Each API cache object now contains the time it was stored. This allows
each cache object to time out individually (fixes #10)
- Added useragent_string() and useragent_timeout() (overrides constants)
- Added new POD section detailing the constants/overrides
- Fix issue in token validation where the token would always be classified
as expired
- All Tesla API calls are now routed through a new _tesla_api_call() method;
accepts a $request, returns a $response. This allows all calls to route
through the API retry functionality
- Added _api_attempts(); returns the number of attempts we've made for each
individual call to Tesla's API
- Renamed _cache() to _api_cache()
- Renamed CACHE_FILE to AUTH_CACHE_FILE
- Added _authentication_cache_file() which allows changing the default
AUTH_CACHE_FILE path to something custom (primarily for testing)
- Moved call to _authentication_code() from _access_token() to
_access_token_generate()
- Rename _access_token_validate() to _access_token_valid()
- _tesla_api_call() now returns $status, $code and
$response->decoded_content
- Add tests for nearly the entire authentication and access token routines
- Add prereq of Mock::Sub for test suite
- useragent_timeout() now croaks if timeout param isn't an int or float
- Removed object_data(). Wasn't being used, and essentially just stored the
api_cache() anyways
- api_cache_time() croaks if an int isn't sent in
- Added api_cache_data(), returns the entire API cache (primarily for
testing)
0.10 2022-04-11
- Remove erroneous call example from Tesla::Vehicle from the SYNOPSIS
- Added prereq of LWP::Protocol::https
- Remove WWW::Mechanize timeout (it defaults to 180 secs in LWP::UserAgent)
- Add API_TIMEOUT_RETRIES; If a Tesla API call times out, try it again this
many times
- Accept PR #9 (fix compatibility with JSON < 4) and apply that change to
all instances of encode_json()
0.09 2022-03-22
- In CI script, manually install File::ShareDir::Install, as it doesn't get
installed by default the way we configure the test run (was throwing "! No
MYMETA file is found after configure. Your toolchain is too old?" error on
the 'cpanm --installdeps .' command).
- api() now requires all parameters sent in as a hash
0.08 2022-03-22
- We now store endpoints.json and option_codes.json in a share directory
with the library (closes #4)
- Added update_data_files(), updates the endpoints.json and
option_codes.json files this library uses if they have in fact been
changed
- Added option_codes
0.07 2022-03-21
- POD corrections
0.06 2022-03-20
- Made "API CACHE METHODS" section a head1 in POD
0.05 2022-03-20
- DEBUG_API_CACHE now retrieved from $ENV{DEBUG_TESLA_API_CACHE} instead of
having it as a magic number (so we don't accidentally publish the code
with it set ;)
- Make EXAMPLE POD section a head1; accidentally had it as a head2
- Moved all cache methods in POD to their own METHOD section
0.04 2022-03-20
- Fix issue where we were assigning to the wrong variable in
api_cache_time()
- Renamed $api_cache_time to $api_cache_alive_time to be non-ambiguous to
the api_cache_time() method
- Added api_cache_persist() and api_cache_persist param. Allows temporarily
or permanently returning the cached Tesla API data
- Added entire section in POD dealing exclusively with the API caching
mechanism
0.03 2022-03-19
- Added api_clear_cache() for methods that need to daisy chain calls, but
require fresh data between them
- Added ability to send in an additional param, $api_params to api(), so
that we can send them to the API as JSON body content
(eg. $vehicle->trunk_actuate with 'which_trunk' => 'rear');
0.02 2022-03-18
- Removed all vehicle related stuff and moved it into a separate subclass
distribution, Tesla::Vehicle. This distribution will only be for the
managing of access tokens and speaking to the Tesla API directly
- Cleaned up documentation about "id" param in new(). The children
classes must take care of this
- Added full blown caching mechanism to cache endpoint/id pair data for
each call through the Tesla API (closes #3)
- Access tokens now track their own expiry, and auto-refresh when needed
(closes #2)
0.01 2022-03-16
- Auto generated distribution with Dist::Mgr
- Prompt user to authenticate via URL, and to paste new URL back into
console
- Auto generate access token, and stash home directory cache
- Impemented api(), which will use endpoints() for all Tesla API calls
- Implemented rudimentary vehicle ID handling
- Implemented initial basic list of API functionality
- Tesla API endpoints are stored in __DATA__ for the time being