Skip to content

Commit

Permalink
Update readme (#15)
Browse files Browse the repository at this point in the history
* Updated readme

* fix pre-commit
  • Loading branch information
DurgNomis-drol authored Mar 17, 2021
1 parent 5462d9d commit fa54486
Showing 1 changed file with 15 additions and 57 deletions.
72 changes: 15 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Toyota Connected Services Python module

### [!] **This has not been published to PyPi yet**
### [!] **This is still in beta**

## Description

Expand All @@ -17,82 +17,40 @@ pip install mytoyota
## Usage

```python
import aiohttp
import asyncio
from mytoyota.client import MyT

username = "[email protected]"
password = "MyPassword"
locale = "da-dk"
session = aiohttp.ClientSession()

client = MyT(locale=locale, session=session)
client = MyT(username=username, password=password, locale=locale, region="europe")

print("Performing login...")
client.perform_login(username=username, password=password)

async def get_cars()
print("Retrieving cars...")
valid, cars = await client.get_cars()

if valid:
print(cars)
return

loop = asyncio.get_event_loop()
loop.run_until_complete(get_cars())
loop.close()
```
async def get_information():
print("Performing login...")
print(await client.get_token())
print(client.get_uuid())

### Get odometer information

```python
async def get_odometer(vin)
print("Retrieving odometer information...")
odometer, odometer_unit, fuel = await client.get_odometer(vin=vin)
print("Retrieving cars...")
# Returns information about the cars registered to your account
cars = await client.gather_information_json()

print(odometer)
print(odometer_unit)
print(fuel)
print(cars)

loop = asyncio.get_event_loop()
loop.run_until_complete(get_odometer(vin))
loop.run_until_complete(get_information())
loop.close()
```

### Get parking information

```python
async def get_parking(vin)
print("Retrieving latest parking information...")
parking = await client.get_parking(vin=vin)

print(parking)

loop = asyncio.get_event_loop()
loop.run_until_complete(get_parking(vin))
loop.close()
```

### Get vehicle information
## Docs

```python
async def get_vehicle_info(vin)
print("Retrieving vehicle information...")
battery, hvac, last_updated = await client.get_vehicle_information(vin=vin)

print(battery)
print(hvac)
print(last_updated)

loop = asyncio.get_event_loop()
loop.run_until_complete(get_vehicle_info(vin))
loop.close()
```
Coming soon...

## Contributing

This python uses poetry and pre-commit.
This python module uses poetry and pre-commit.

To start contributing, fork this repository and run `poetry install`. Then create a new branch. Before making a PR, please run pre-commit `poetry run pre-commit run --all-files` and make sure that all tests passes locally first.

Expand All @@ -102,4 +60,4 @@ As I [@DurgNomis-drol](https://github.com/DurgNomis-drol) is not a professional

## Credits

A huge thanks go to [@calmjm](https://github.com/calmjm) for making [tojota](https://github.com/calmjm/tojota). Which is used as the base for making this module.
A huge thanks go to [@calmjm](https://github.com/calmjm) for making [tojota](https://github.com/calmjm/tojota).

0 comments on commit fa54486

Please sign in to comment.