Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error connection #95

Open
kurb77 opened this issue Dec 25, 2024 · 3 comments
Open

Error connection #95

kurb77 opened this issue Dec 25, 2024 · 3 comments

Comments

@kurb77
Copy link

kurb77 commented Dec 25, 2024

Hello,
for a few days I can no longer connect to the API. Anything to change? I am using a version of the lnetatmo API that is not up to date, is that why?
Thanks

code=400, reason=, body=b'{"error":"invalid_grant"}' Traceback (most recent call last): File "/home/domoticz/myscript/netatmo.py", line 69, in <module> thermostat = lnetatmo.ThermostatData(authorization) File "/myscript/lnetatmo.py", line 357, in __init__ self.getAuthToken = authData.accessToken File "/myscript/lnetatmo.py", line 241, in accessToken if self.expiration < time.time() : self.renew_token() File "/myscript/lnetatmo.py", line 252, in renew_token if self.refreshToken != resp['refresh_token']: TypeError: 'NoneType' object is not subscriptable

@philippelt
Copy link
Owner

The error is "error":"invalid_grant"
Recreate your access+refresh token for your apps and update your credential file.

It would be better to use an up to date release of the library. The current version still support python 2 if this is why you are afraid to update...

Happy Christmas!

@kurb77
Copy link
Author

kurb77 commented Dec 26, 2024

ok, i will try
thank you
happy Christmas too

@kurb77
Copy link
Author

kurb77 commented Dec 26, 2024

I Recreated my access+refreshed token and updated the library, all work, thank you.
i added some fonctions on the library for the thermostat, it is possible to add on the ref ?

#on class ThermostatData:
def Thermostat_DataByName(self,name=None):
def Relay_Plug(self, _id=None,module_name=None):
def getIdplaningActif(self,name=None):
def getNameplaningActif(self,name=None):
def setPlaningById(self, home_id=None, program_id=None):
def update(self):
def getPlaningActifByName(self, name=None):

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants