Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: add support for solar systems and powerwall (#341) #353

Merged
merged 1 commit into from
Oct 12, 2022
Merged

Conversation

alandtse
Copy link
Collaborator

  • 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]

- 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]>
@alandtse alandtse merged commit 085a6e1 into master Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants