Skip to content

Lightweight Python API client for the Tesla API.

License

Notifications You must be signed in to change notification settings

tyddynonn/tesla_api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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('[email protected]', '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('[email protected]', '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())

About

Lightweight Python API client for the Tesla API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%