Skip to content

Commit

Permalink
2.1.30 #60
Browse files Browse the repository at this point in the history
  • Loading branch information
jimboca committed Sep 14, 2020
1 parent d513269 commit 9c129a5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ If you already have it installed and want the update before it's in the store.

## Release Notes

- 2.1.30: JimBo 09/13/2020
- Temporary fix for https://github.com/Einstein42/udi-ecobee-poly/issues/60
- May have to update after hearing back from Ecobee.
- 2.1.29: JimBo 09/11/2020
- Fix bug introduced in previous version that only affects a new install
- Also fix ecobee login url
Expand Down
8 changes: 7 additions & 1 deletion ecobee-poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,20 @@ def _getRefresh(self,test=False):
else:
# https://www.ecobee.com/home/developer/api/documentation/v1/auth/auth-req-resp.shtml
if 'error' in res_data:
self.set_ecobee_st(False)
self.addNotice({'grant_error': "{}: {} ".format(res_data['error'], res_data['error_description'])})
self.addNotice({'grant_info': "For access_token={} refresh_token={} expires={}".format(self.tokenData['access_token'],self.tokenData['refresh_token'],self.tokenData['expires'])})
LOGGER.error('Requesting Auth: {} :: {}'.format(res_data['error'], res_data['error_description']))
LOGGER.error('For access_token={} refresh_token={} expires={}'.format(self.tokenData['access_token'],self.tokenData['refresh_token'],self.tokenData['expires']))
# Set auth to false for now, so user sees the error, even if we correct it later...
# JimBo: This can only happen if our refresh_token is bad, so we need to force a re-auth
if res_data['error'] == 'invalid_grant':
self._reAuth('{}'.format(res_data['error']))
self._endRefresh(test=test)
elif res_data['error'] == 'invalid_client':
# We will Ignore it because it may correct itself on the next poll?
LOGGER.error('Ignoring invalid_client error, will try again later for now, but may need to mark it invalid if we see more than once? See: https://github.com/Einstein42/udi-ecobee-poly/issues/60')
else:
LOGGER.error('Unknown error, not sure what to do here. Please Generate Log Package and Notify Author with a github issue: https://github.com/Einstein42/udi-ecobee-poly/issues')
return False
elif 'access_token' in res_data:
self._endRefresh(res_data,test=test)
Expand Down
2 changes: 1 addition & 1 deletion server.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"title": "ecobee: Polyglot NodeServer for Ecobee",
"author": "James Milne (Einstein.42)",
"version": "2.1.29",
"version": "2.1.30",
"date": "July 25, 2018",
"source": "https://github.com/Einstein42/udi-ecobee-poly",
"license": "https://github.com/Einstein42/udi-ecobee-poly/master/LICENSE"
Expand Down

0 comments on commit 9c129a5

Please sign in to comment.