Git Product home page Git Product logo

teslajson's People

Contributors

gglockner avatar the-mace avatar toringe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

teslajson's Issues

Cleanup of http connection?

Is there a way to close the http connections when the requests and posts are done?

Our vehicle seems to be awake all the time an I have the suspicion that it is because the API is connected all the time...

HTTP Error 403: Forbidden url

access_token

Hi there, in the prior version of the library it was possible to access the Connection.access_token value which allowed for caching of the access token for extended periods and allowed me to pass it back in later. The recent changes broke that interface (access_token no longer there) and prohibits caching of the token.

Plans to publish to pypi?

Nice repo but do you have any plans to publish to pypi so that it's easier for people to use this module?

Streaming

does anyone have experience with the streaming of vehicle data.
Is there an example in Python?

This library is used for harvesting Tesla login credentials?

It is, to say the least, extremely suspicious that this library gets the Tesla API base URL from a pastbin.com URL managed by the maintainer (@gglockner). This would suggest that all login credentials from the clients using this can be relayed to anywhere he wants.

tesla_client = self.__open("/raw/0a8e0xTJ", baseurl="http://pastebin.com")

For this reason I would advise caution using it and at least fork and modify the code.

Parms

Hi there, theres a small tweak needed to allow things like sunroof state to be passed through. I can commit the changes but I don't have access. Thanks for making this little library available.

Attached is the file with the changes if you want to preview.
teslajson.py.zip

not an issue: feedback

hello Greg
Firstly, this is not an issue! Its more of understanding python constructors
thanks for sharing the example code. I am looking for a way to code a constructor which can be more modular. In your code, I see its a long function with quite a few things. How can I define some functions which constructor can call?
I tried calling other class methods but I am getting scope error (undefined)
such breakdown is more modular and maybe reusable elsewhere

thanks
Sriram

command/share

I simply cannot get the sharing of navigation to work. Neither sharing media for that matter. It always returns a 500 error code. Might be connected to #19

Code:

import teslajson, time; c = teslajson.Connection('youremail', 'yourpassword'); v = c.vehicles[0]; location = '59.9375206,10.9285069'; params = {'type':'share_ext_content_raw','value':{'android.intent.extra.TEXT':location},'locale':'en-US','timestamp_ms':str(time.time())[:10]}; v.command('navigation_request',params):

email specification gives me error.

Hi

I copied the sample odometer script and just calling as is, seems to give me an error as shown below. Any idea about how to fix it?

File "./tesla.py", line 7, in
TESLA_EMAIL = os.environ['[email protected]']
File "/usr/lib64/python2.7/UserDict.py", line 23, in getitem
raise KeyError(key)
KeyError: '[email protected]'

recent auth issues?

code and pw have not changed but i have not been able to auth for two days or so. anyone else experiencing this?

87, in fetch_sso_token
m = re.search('code=([^&]*)',r.headers['location'])
File "/usr/local/lib/python3.6/site-packages/requests/structures.py", line 52, in getitem
return self._store[key.lower()][1]
KeyError: 'location'

http error 408 timeout

I get a lot of http 408 (timeout) errors when I try to do a .get (e.g., charge_state = v.get('data_request/charge_state')

Is there a timeout parameter that I should modify to avoid this?

HTTP Error 500

I get this error sometimes and the script breaks. I think this is caused by the Tesla Servers being unavailable. Any way to try it again until it works or have some proper return?

Moved Permanently ?

been using this for a while, simple query for status failed this evening.

urllib2.HTTPError: HTTP Error 301: The HTTP server returned a redirect error that would lead to an infinite loop.
The last 30x error message was:
Moved Permanently

Connection Issues?

Anyone else getting access issues suddenly? no changes on my end!

File "/var/www/scripts/notify/teslajson/teslajson.py", line 72, in init
self.vehicles = [Vehicle(v, self) for v in self.get('vehicles')['response']]
File "/var/www/scripts/notify/teslajson/teslajson.py", line 76, in get
return self.post(command, None)
File "/var/www/scripts/notify/teslajson/teslajson.py", line 82, in post
auth = self.__open("/oauth/token", data=self.oauth)
File "/var/www/scripts/notify/teslajson/teslajson.py", line 119, in __open
resp = opener.open(req)
File "/usr/lib/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 475, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 400: Bad Request

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.