Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed 401 Client Error #6 and implemented token refreshing #7

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
[![PyPI version](https://badge.fury.io/py/fordpass.svg)](https://badge.fury.io/py/fordpass)

# fordpass-python

This is a basic Python wrapper around the FordPass APIs. The wrapper provides methods to return vehicle status as well as some basic commands, e.g. start/stop, lock/unlock.

It's more or less a straight port of @d4v3y0rk's NPM module [d4v3y0rk/ffpass](https://github.com/d4v3y0rk/ffpass-module) - props to him for his work figuring out the relevant API requests needed.

Forked from [clarkd/fordpass-python](https://github.com/clarkd/fordpass-python) and currently mantained by me.

## Features

* Automatically auth & re-fetches tokens once expired
* Get status of the vehicle (this returns a ton of info about the car: lat/long, oil, battery, fuel, odometer, tire pressures, open windows and a bunch of other stuff that may/may not apply to your car, e.g. charge level, diesel filters.)
* Start the engine (if supported)
* Stop the engine (if supported)
* Lock the doors
* Unlock the doors
- Automatically auth & re-fetches tokens once expired
- Get status of the vehicle (this returns a ton of info about the car: lat/long, oil, battery, fuel, odometer, tire pressures, open windows and a bunch of other stuff that may/may not apply to your car, e.g. charge level, diesel filters.)
- Start the engine (if supported)
- Stop the engine (if supported)
- Lock the doors
- Unlock the doors

## Install

Install using pip:

```
Expand All @@ -42,4 +43,4 @@ demo.py [email protected] mypassword WX12345678901234
2. Build the package: `python setup.py sdist bdist_wheel`.
3. Upload to TestPyPi using `twine upload --repository-url https://test.pypi.org/legacy/ dist/*` and verify everything is as expected.
4. Upload to PyPi using `twine upload dist/*`.
5. All done!
5. All done!
2 changes: 1 addition & 1 deletion fordpass/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .fordpass import Vehicle
from .fordpass import Vehicle
12 changes: 7 additions & 5 deletions fordpass/bin/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
if __name__ == "__main__":

if len(sys.argv) != 4:
raise Exception('Must specify Username, Password and VIN as arguments, e.g. demo.py [email protected] password123 WX231231232')
else:
r = Vehicle(sys.argv[1], sys.argv[2], sys.argv[3]) # Username, Password, VIN
raise Exception(
"Must specify Username, Password and VIN as arguments, e.g. demo.py [email protected] password123 WX231231232"
)
else:
r = Vehicle(sys.argv[1], sys.argv[2], sys.argv[3]) # Username, Password, VIN

print(r.status()) # Print the status of the car
print(r.status()) # Print the status of the car

# r.unlock() # Unlock the doors

# time.sleep(10) # Wait 10 seconds

# r.lock() # Lock the doors
# r.lock() # Lock the doors
Loading