Closed aviadoffer closed 1 year ago
This looks like it might be #30 which I'm planning on fixing tonight
Thanks
thanks for fixing this again so quickly. I recently updated and must have missed some auth changes.
I was previously reading the keys.json and parsing the tokens out. if ('email' not in data or 'password' not in data) and ('idToken' not in data or 'accessToken' not in data or 'refreshToken' not in data):
It looks like the tokens are now stored as id_token, access_token etc. When did that happen to change?
That was changed in this latest release. I'm in the process of refactoring the authentication process to align it better with what's expected by Home Assistant which allows for an application to manage the tokens themselves instead of pyemvue doing all of it. Take a look at the new Auth class and you'll see that you can override how tokens are refreshed and can pass in a callback method to be alerted when a refresh happens. https://github.com/magico13/PyEmVue/blob/master/pyemvue/auth.py