Skip to content

Commit

Permalink
feat!: add support for solar systems and powerwall (#341)
Browse files Browse the repository at this point in the history
- New module `car.py` that contains a `TeslaCar` class.
- New module `energy.py` that contains energy site classes.
- New method `Controller.generate_car_objects` that generates `TeslaCar` objects and stores them into `self.cars` by vin.
- New method `Controller.generate_energysite_objects` that generates `SolarSite`, `PowerwallSite` or `SolarPowerwallSite` objects and stores them in the `self.energysites` dictionary by `energysite_id`.
- Modified `Controller.update` to now just send a single request to the `PRODUCT_LIST` endpoint (instead of both `PRODUCT_LIST` and `VEHICLE_LIST` to get all products on a Tesla account. From there, create a list of cars `self._vehicle_list` and energy sites `self._energysite_list`.
- Storing JSON responses as-is into their own dictionary by VIN for cars and energysite_id for energysites. These are then passed to `TeslaCar` and `EnergySite` when instantiated.
- Added `include_vehicles` and `include_energysites` arguments to `Controller.connect` which default to True. This provides the option to completely ignore vehicles or energysites.
- Removed `Controller.command`, `Controller.get` and `Controller.post` methods. Only `Controller._wake_up` was using `post` which now uses `Controller.api`.
- Removed all Home Assistant specific modules.
- Removed some unused code specific to energy sites.
- Changes to some naming to try to better align with what the Tesla API uses.

closes #348
closes #334 
closes #24 

BREAKING CHANGE: HomeAssistant specific code has been moved out. The API is now just a communication layer

Co-authored-by: Alan D. Tse <[email protected]>
  • Loading branch information
shred86 and alandtse authored Oct 12, 2022
1 parent 14b467b commit 5827dc9
Show file tree
Hide file tree
Showing 117 changed files with 5,501 additions and 11,378 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# teslajsonpy

[![Version status](https://img.shields.io/pypi/status/teslajsonpy)](https://pypi.org/project/teslajsonpy)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Python version compatibility](https://img.shields.io/pypi/pyversions/teslajsonpy)](https://pypi.org/project/teslajsonpy)
Expand Down Expand Up @@ -35,6 +36,7 @@ Also thanks to [Tim Dorr](https://tesla-api.timdorr.com/) for documenting the AP
12. Submit a [pull request](https://github.com/zabuldon/teslajsonpy/pulls)!

# Documentation

[API docs](https://teslajsonpy.readthedocs.io/en/latest/).

# License
Expand Down
Binary file modified docs/html/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/html/.doctrees/index.doctree
Binary file not shown.
Binary file modified docs/html/.doctrees/teslajsonpy/teslajsonpy.__version__.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/html/.doctrees/teslajsonpy/teslajsonpy.connection.doctree
Binary file not shown.
Binary file modified docs/html/.doctrees/teslajsonpy/teslajsonpy.const.doctree
Binary file not shown.
Binary file modified docs/html/.doctrees/teslajsonpy/teslajsonpy.controller.doctree
Binary file not shown.
Binary file modified docs/html/.doctrees/teslajsonpy/teslajsonpy.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/html/.doctrees/teslajsonpy/teslajsonpy.exceptions.doctree
Binary file not shown.
Binary file modified docs/html/.doctrees/teslajsonpy/teslajsonpy.teslaproxy.doctree
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5827dc9

Please sign in to comment.