watchforstock / evohome-client

Python client to access the Evohome web service
Apache License 2.0
88 stars 52 forks source link

WIP: Allow injection of access tokens #77

Closed zxdavb closed 5 years ago

zxdavb commented 5 years ago

@watchforstock, I am not sure if this is a good idea, or not. I am not sure if it will work with Python 2.

It should be a non-breaking change, as users will still pull the tokens from (e.g.) c.refresh_token.

However, it will also allow:

c.access_token = "xxx"
c.access_token_expires = datetime("xxx")
watchforstock commented 5 years ago

I'm not entirely sure this is necessary. In the current code you can write to those variables as they're not private. There's nothing in your setter to make sure that there aren't concurrent updates (less of an issue with Python than other languages). Does injecting the values not work with the current code?