Skip to content

Commit

Permalink
Fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Bre77 committed Feb 21, 2024
1 parent b3f8fe3 commit 4003164
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ This is the base class, however can also be used directly if you have a valid us
import asyncio
import aiohttp
from tesla_fleet_api import TeslaFleetApi, TeslaFleetError
from tesla_fleet_api import TeslaFleetApi
from tesla_fleet_api.exceptions import TeslaFleetError
async def main():
Expand All @@ -28,7 +29,7 @@ async def main():
try:
data = await api.vehicle.list()
print(data)
except TeslaFleetError.Base as e:
except TeslaFleetError as e:
print(e.message, e.error)
asyncio.run(main())
Expand All @@ -38,6 +39,8 @@ asyncio.run(main())
This extends TeslaFleetApi to support OAuth, and requires a client_id, and either a refresh_token or initial authentication code.

```
from tesla_fleet_api import TeslaFleetOAuth
from tesla_fleet_api.exceptions import TeslaFleetError
import json
async def main():
Expand All @@ -56,7 +59,7 @@ async def main():
try:
data = await api.vehicle.list()
print(data)
except TeslaFleetError.Base as e:
except TeslaFleetError as e:
print(e.message, e.error)
with open("auth.json", "w") as f:
Expand Down

0 comments on commit 4003164

Please sign in to comment.