Closed zxdavb closed 5 years ago
The reason is the regression in line 112: https://github.com/watchforstock/evohome-client/blob/f1cb9273e97946d79c0651f00a218abbf7ada53a/evohomeclient2/__init__.py#L110-L115
Should have instead except AuthenticationError:
:
https://github.com/zxdavb/evohome-client/blob/4bb338998e49315bb07c166ede93bd8570bddfaf/evohomeclient2/__init__.py#L110-L115
This is because in _obtain_access_token()
, we introduced some raise
s towards the end of the refactoring:
try:
response.raise_for_status()
except requests.HTTPError:
msg = "Unable to obtain an Access Token"
if response.text: # if there is a message, then raise with it
msg = msg + ", hint: " + response.text
raise AuthenticationError(msg)
...
except KeyError:
raise AuthenticationError("Unable to obtain an Access Token, "
"hint: " + response_json)
except ValueError:
raise AuthenticationError("Unable to obtain an Access Token, "
"hint: " + response.text)
I have tested a solution, as above, and will submit a PR shortly.
@watchforstock Thanks for merging to master - any chance you could push this to PyPi as a new release? I am implementing a feature in HomeAssistant that requires this fix.
@zxdavb Sorry for the delay - v0.3.3 is now available in PyPI...
Thanks!
This is what should happen when the
refresh_token
is invalid (FWIW theaccess_token
is expired):This is what I'm getting: