watou / vera-ecobee

Vera Plugin for ecobee Thermostat
7 stars 5 forks source link

Auth tokens are still prematurely discarded #23

Closed watou closed 8 years ago

watou commented 8 years ago

Wait until we've received invalid_client 5 consecutive times before throwing away the auth token, which then precipitates the need for a new PIN retrieval and registration. Currently, it will throw away the auth token the first time it receives an invalid_client response.

Why do this? To work around the extremely unlikely situation where maybe, just maybe, the Ecobee API reports invalid_client incorrectly, so it's given four more times to get it right. If, after 5 consecutive invalid_client responses, the problem has not cleared up, then the cause is a bug in Vera's persistence feature for device variables, in which case the Vera folks have to fix their bug.

See this discussion.