nkgilley / python-ecobee-api

Python API for controlling Ecobee Thermostats
MIT License
44 stars 40 forks source link

Refactor python-ecobee-api #45

Closed marthoc closed 4 years ago

marthoc commented 4 years ago

Refactor the library to use a single request interface to the ecobee API, which has the advantage of unifying error handling and debug logging. Added type and return hinting to class methods. Raise InvalidTokenError when ecobee API response indicates that the refresh token has become invalid (signalling to the client that new tokens need to be obtained from the API, i.e. a new auth process needs to be undertaken). This commit also lays the groundwork for converting the library to async, and as a consequence breaks handling of a passed-in config filename (new method will need to be called after the class constructor is called), but this will not affect Home Assistant as auth is now config-flow-based (no config file is used).

nkgilley commented 4 years ago

Thanks!