Comments (3)
Are you using different versions of TeslaPy on your machines? This requests exception probably occurs because the Tesla instance is accessed outside of the context manager. Recent versions of TeslaPy destroy the connection adapter when the context manager exits.
from teslapy.
Thanks Tim.
The other machines were on 2.2.0 and the Ubuntu machine was running 2.5.0.
I put 2.2.0 on the Ubuntu machine and all seems fine now.
Thanks so much!
Jim
from teslapy.
Maybe these two examples help. A context manager automatically closes the requests session. TeslaPy 2.5.0 also closes the connection adapter. This has been done because the requests module doesn't reconnect on network failures once it has been closed. So for long running scripts TeslaPy 2.5.0 is the recommended version.
With context manager:
with teslapy.Tesla('[email protected]') as tesla:
vehicles = tesla.vehicle_list()
vehicles[0].command('FLASH_LIGHTS')
vehicles[0].command('FLASH_LIGHTS') # Causes exception
Without context manager:
tesla = teslapy.Tesla('[email protected]')
vehicles = tesla.vehicle_list()
vehicles[0].command('FLASH_LIGHTS')
tesla.close()
vehicles[0].command('FLASH_LIGHTS') # Causes exception
from teslapy.
Related Issues (20)
- How to call `mobile-app/*` endpoints?
- Error 404 in every endpoint HOT 2
- (missing_token) Missing access token parameter. HOT 14
- Powerwall - cannot retrieve the mode HOT 3
- 429 on every sync_wake_up() call HOT 3
- last_seen() raises "Timestamp is in the future" error HOT 3
- No longer able to set Powerwall to self_consumption mode HOT 6
- Percentage Charged not updating on get_battery_data()
- Preconditioning Battery
- Authorization broken -> Always getting "Access Denied" HOT 1
- Solar panel power only updates sporadically HOT 2
- Fails to work when run in a daemon process. HOT 2
- 410 error on get_battery_data HOT 15
- 400 Client Error: time_of_use_settings
- latitude and longitude are not in drive_state HOT 3
- Selenium blocked by Tesla HOT 2
- Move to Fleet API and Tesla Vehicle Command SDK HOT 5
- I get an InvalidSchema("No connection adapters were found for 'https://owner-api.teslamotors.com/api/1/vehicles/) Exception when using vehicle.get_vehicle_data() HOT 1
- Powerwall function get_battery_data not working HOT 1
- Not able to login HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teslapy.