Git Product home page Git Product logo

Comments (4)

danielpatenaude avatar danielpatenaude commented on June 24, 2024

Heya Ronald,

This token refresh has been one of the most annoying things about the new v4 API. My best guess is not being able to refresh an expired token is a limitation of the free Enlighten Watt plan, and that maybe the paid plans have a better way to achieve this? At least that seems to be the issue with the daily inverter telemetry data that rjjkm pointed out in Issue #4. So maybe it applies for this feature as well.

As far as having a way in python to refresh that, I'd love to have that. Unfortunately that may be a bit beyond my python expertise haha. The selenium script is a clever way to circumvent that issue, and I'm not sure how to apply that principle here to python ☹. But since my python script needs to run daily (because of the inverter telemetry free Watt plan limitation #4 ) I got around that by just making a new token every single day.

from python_enlighten_api.

bartverweire avatar bartverweire commented on June 24, 2024

Hello,

I don't think you really need the refresh token.
With some slight modifications, I can keep on using the api, without ever manually refreshing the token.

See https://github.com/bartverweire/py-shiny-enphase/blob/main/enlighten.py for the modifications.

  • I have two methods : __get_access_token, and __refresh_access_token
  • if the refresh fails, I can simply call __get_access_token, and that seems to work
  • __assert_success now throws an exception if the response is not 200
  • I keep track of the access token expiry date

I should probably create a pull request, but I'm not very familiar with that, sorry.
Fyi. my project is about visualizing the telemetry information with a Shiny webpage, but it's not clearly documented yet. I hope to update that soon.

Regards,

Bart

from python_enlighten_api.

danielpatenaude avatar danielpatenaude commented on June 24, 2024

Hmmm, that's very interesting. I'll take a peak at your changes when I have some time and see if I can integrate them in to this project.

Thanks!

from python_enlighten_api.

erdebe avatar erdebe commented on June 24, 2024

from python_enlighten_api.

Related Issues (7)

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.