Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian committed Jan 6, 2022
1 parent 15add36 commit 80a655e
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#

![ConnectedCar Python SDK Logo](https://user-images.githubusercontent.com/35158392/147300580-29723aab-ffae-46d3-ae60-72af59065daa.png)

The ConnectedCar Python SDK is an open-source, python package that provides the ability to send commands to your Ford Sync Connect connected vehicle.

# Installation [![PyPI version](https://badge.fury.io/py/connectedcar.svg)](https://badge.fury.io/py/connectedcar)
## Installation [![PyPI version](https://badge.fury.io/py/connectedcar.svg)](https://badge.fury.io/py/connectedcar)

```sh
python3 -m pip install connectedcar
Expand All @@ -12,17 +14,14 @@ Requirements

- To make requests to a vehicle, the end user must have signed up for an account using [Ford Pass](https://owner.ford.com/fordpass/fordpass-sync-connect.html). These credentials will be used to authenticate your requests.

<br></br>

# Getting Started
## Getting Started

Import the ConnectedCar SDK

```python
import connectedcar
```

<br></br>
Create a new connectedcar `client`

- Note the default ConnectedCar client_id is
Expand All @@ -32,7 +31,6 @@ Create a new connectedcar `client`
client = connectedcar.AuthClient('9fb503e0-715b-47e8-adfd-ad4b7770f73b', None, None)
```

<br></br>
Use `client.get_user_access_token()` to exchange your user credentials for an **access object**. To make any vehicle data request to the Ford Sync Connect API, you'll need to give the SDK a valid **access token**.

```python
Expand All @@ -52,14 +50,12 @@ This access object will look like this:
}
```

<br></br>
Access tokens will expire every 2 hours, so you'll need to constantly refresh them by calling `client.exchange_refresh_token()`

```python
refreshToken = client.exchange_refresh_token(access['refresh_token'])
```

<br></br>
With your access token in hand, use `connectedcar.User()` to get a User object representing the user.

```python
Expand All @@ -68,7 +64,6 @@ user = connectedcar.User(access['access_token'], "US") # Region argument is only

- Note: If your region is outside of the US you can pass different region parameters to the User class. Regions: (US, CA, EU, AU)

<br></br>
Use `user.vehicles()` to return an array of all the vehicles associated with a users account. The response will include the **vehicle vin**.

```python
Expand All @@ -80,7 +75,6 @@ for userVehicle in vehicles: # For each user vehicle
vehicleList.append(userVehicle['vin'])
```

<br></br>
Now with a **vehicle vin** in hand, use `connectedcar.Vehicle()` to get a Vehicle object representing the user's vehicle.

```python
Expand All @@ -89,23 +83,20 @@ currentVehicle = connectedcar.Vehicle(vehicleList[0], access['access_token'], "U

- Note: If your region is outside of the US you can pass different region parameters to the Vehicle class. Regions: (US, CA, EU, AU)

<br></br>
Now you can ask the car to do things, or ask it for some data! For example:

```python
currentVehicle.start()
```

<br></br>

# Examples & Documentation
## Examples & Documentation

For more examples on what you can do with Sync Connected car, see the [examples](/examples) folder or take a peek at the [documentation](https://ianjwhite99.github.io/connected-car-python-sdk/).

# Funding & Support
## Funding & Support

If you are interested in supporting the development of my projects check out my [patreon](https://www.patreon.com/ianjwhite99) or [buy me a coffee](https://www.buymeacoffee.com/ianjwhite9).

# Disclaimer
## Disclaimer

THIS CODEBASE IS NOT ENDORSED, AFFILIATED, OR ASSOCIATED WITH FORD, FOMOCO OR THE FORD MOTOR COMPANY.

0 comments on commit 80a655e

Please sign in to comment.