the-mace / rivian-python-api Goto Github PK
View Code? Open in Web Editor NEWA Python API and CLI for getting information about your Rivian account and Vehicle(s)
License: MIT License
A Python API and CLI for getting information about your Rivian account and Vehicle(s)
License: MIT License
When I attempt to retrieve my vehicle orders, I receive a traceback before all information is displayed.
Vehicle Orders:
Order ID:
Order Date: 2021-04-27T03:06:04.696Z
Config State: CONFIGURED
Order State: CANCELLED
Status: None
Item: ACERAWM001
Customer flow complete: No
Traceback (most recent call last):
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 1205, in
main()
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 685, in main
delivery_status = delivery(order['id'], args.verbose)
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 345, in delivery
vehicle['vin'] = response_json['data']['delivery']['vehicleVIN']
TypeError: 'NoneType' object is not subscriptable
I do have two vehicles in my order history. One of which was canceled and a second one I am soft locked on. Not sure if that is what is causing an issue.
So I reviewed the most recent android app, and this is the android app query for the tire pressure:
subscription tirePressureState($vehicleID: String!) { vehicleState(id: $vehicleID) { tirePressureStatusFrontLeft { timeStamp value } tirePressureStatusFrontRight { timeStamp value } tirePressureStatusRearLeft { timeStamp value } tirePressureStatusRearRight { timeStamp value } tirePressureFrontLeft { timeStamp value } tirePressureFrontRight { timeStamp value } tirePressureRearLeft { timeStamp value } tirePressureRearRight { timeStamp value } } }
Unfortunately, trying to put those new fields into the vehicle state query doesn't seem to work. I'm guessing maybe they only work when you do a subscription instead of a query? Unfortunately, supporting a subscription seems to be a little complex.
Not sure if someone can figure out how to add those tire pressure fields.
I'm trying to test the API, and as recommended I made a seperate account for API use, this account has no keys, has never used the app, has never made an order, etc.
When using a command that needs a vehicle ID, like --state, currently the code runs the command for vehicle_orders to find a vehicle. This doesn't work in this case, as I have no order, instead the user info provides the correct info.
When I attempt to run any of the functions (e.g. --vehicles, --state, --last_seen, --ota, --poll, --charging_schedule, --live_charging_session, --live_charging_history) I receive a traceback.
Traceback (most recent call last):
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 1214, in
main()
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 742, in main
details = order_details(order['id'], verbose)
File "/root/rivian-python-api/src/rivian_python_api/rivian_cli.py", line 129, in order_details
'vehicleId': response_json['data']['order']['vehicle']['vehicleId'],
TypeError: 'NoneType' object is not subscriptable
The trace looks identical for each of these functions. I think this may be because I have a canceled order on my account and it isn't being handled properly. I'm happy to provide additional output if needed. Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.