Skip to content

Commit

Permalink
Merge pull request #65 from alandtse/developers
Browse files Browse the repository at this point in the history
docs: add initial developer info
  • Loading branch information
alandtse committed Mar 15, 2020
2 parents e368488 + 1d0a5cb commit ab89698
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions DEVELOPERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Developers Reference

## Core

The files that directly interact with the Tesla API are:
- [connection.py](teslajsonpy/connection.py) - low level access
- [controller.py](teslajsonpy/controller.py) - high level access and api

The controller provides a managed connection to a logged in session and will control access to all vehicles. It also performs throttling on certain commands to avoid overloading the Tesla API and will return cached copies of the JSON datastructure through the following commands.

- get_climate_params
- get_charging_params
- get_state_params
- get_config_params
- get_drive_params
- get_gui_params

If you want access to the API for your own app, you will likely only need to access these files. The other files are examples of an implementation.

## Home Assistant
If you're looking to add functionality to Home Assistant you will need to do the following:
1. Check the [controller](teslajsonpy/controller.py) file to see if an appropriate API call exists. If necessary add them. Check out these references:
- https://www.teslaapi.io/
- https://tesla-api.timdorr.com/
2. Build a proper abstraction inheriting from the [vehicle.py](teslajsonpy/vehicle.py). Check out [lock.py](teslajsonpy/lock.py).
3. Add changes to Home Assistant to access your abstraction and submit a PR per HA guidelines.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Also thanks to [Tim Dorr](https://tesla-api.timdorr.com/) for documenting the AP
2. [Fork the repository](https://github.com/zabuldon/teslajsonpy/fork/new).
3. Install the dev environment: `make init`.
4. Enter the virtual environment: `pipenv shell`
5. Code your new feature or bug fix.
5. Code your new feature or bug fix. [Developers Reference](DEVELOPERS.md)
6. Write a test that covers your new functionality.
7. Update `README.md` with any new documentation.
8. Run tests and ensure 100% code coverage for your contribution: `make coverage`
Expand Down

0 comments on commit ab89698

Please sign in to comment.