Skip to content

Problem with Token renewal #86

Description

@fsneew

Hi there,

Every 10 minutes I use the library to get data from my weather station. Thanks for your work.
It works great but I have problems with the renewal of the token. I happened to me several times.

The logs:
code=400, reason=, body=b'{"error":"invalid_grant"}'
Traceback (most recent call last):
File "/var/www/html/TOOLS/NetAtmo/NetAtmo.py", line 60, in auth
weatherData = lnetatmo.WeatherStationData(authData)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/lnetatmo.py", line 416, in init
self.getAuthToken = authData.accessToken
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/lnetatmo.py", line 241, in accessToken
if self.expiration < time.time() : self.renew_token()
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/lnetatmo.py", line 252, in renew_token
if self.refreshToken != resp['refresh_token']:
~~~~^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

I store my credentials in the file .netatmo.credentials.

Am I the only one having pbs with that ?
Thanks for helping

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions