API client for Tesla
Project description
Tesla API
This is a package for connecting to the Tesla API.
Usage for a vehicle
import asyncio
from tesla_api import TeslaApiClient
async def main():
client = TeslaApiClient('your@email.com', 'yourPassword')
vehicles = await client.list_vehicles()
for v in vehicles:
print(v.vin)
await v.controls.flash_lights()
asyncio.run(main())
Usage for Powerwall 2
import asyncio
from tesla_api import TeslaApiClient
async def main():
client = TeslaApiClient('your@email.com', 'yourPassword')
energy_sites = await client.list_energy_sites()
print("Number of energy sites = %d" % (len(energy_sites)))
assert(len(energy_sites)==1)
reserve = await energy_sites[0].get_backup_reserve_percent()
print("Backup reserve percent = %d" % (reserve))
print("Increment backup reserve percent")
await energy_sites[0].set_backup_reserve_percent(reserve+1)
asyncio.run(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tesla_api-2.0.1.tar.gz
(4.9 kB
view hashes)
Built Distribution
Close
Hashes for tesla_api-2.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c77e0a08244c89f5c75c1b7b591350db56d29d5243d9bd2933c37fe141e3202a |
|
MD5 | becba3da833e04961ffa82dc04927e70 |
|
BLAKE2b-256 | 440417eb10fd318182f6602bb3daecde61ca9e6f28b5fff728968193f98c89f3 |