Giter Site home page Giter Site logo

Comments (6)

erbmur avatar erbmur commented on May 19, 2024

Appears like this issue has already been picked up in the other issue log so ill close this one.

from teslapy.

tdorssers avatar tdorssers commented on May 19, 2024

I have updated the script and Tesla's new SSO and MFA are now supported

from teslapy.

erbmur avatar erbmur commented on May 19, 2024

You will have to forgive me but I have been trying to teach myself python for only a short while. I had managed to work backwords from your previous build to get my project working, but with this new update I don't seem to be able to work out how to use your API.

Previously I would use the below in the own code:

import teslapy

with teslapy.Tesla(EMAIL, PASSWORD, CLIENT_ID, CLIENT_SECRET) as tesla:
tesla.fetch_token()
vehicles = tesla.vehicle_list()
Azurite = vehicles[0]
Azurite_State = Azurite['state']
if Azurite_State != 'asleep':
Azurite_Raw = Azurite.get_vehicle_data()
NearestCharges = Azurite.get_nearby_charging_sites()
else:
with open(os.path.join(location,'Azurite_SavedData.json')) as jsonfile:
Azurite_Raw = json.loads(jsonfile.read())
jsonfile.close

but with the new update I see there are some different arguments that I can't seem to work out. If you could point me in the right direction that would be great?

from teslapy.

tdorssers avatar tdorssers commented on May 19, 2024

Please change the line 'with teslapy.Tesla(EMAIL, PASSWORD, CLIENT_ID, CLIENT_SECRET) as tesla:' to 'with teslapy.Tesla(EMAIL, PASSWORD) as tesla:'. In case you have enabled MFA, then you need to specify a method as the 3rd argument. This method should return the passcode.

from teslapy.

erbmur avatar erbmur commented on May 19, 2024

Thank you so much. I really appreciate the effort you have put into this project and taking the time to answer my question.

from teslapy.

tdorssers avatar tdorssers commented on May 19, 2024

No problem. I have also added support for multiple authentication devices and token refreshing.

from teslapy.

Related Issues (20)

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.