briancmpbll / home_assistant_custom_envoy

177 stars 77 forks source link

Update envoy_reader.py for 6 month token error #17

Closed jrutski closed 2 years ago

jrutski commented 2 years ago

Took a look at this, there's a 302 in the initial login response and I had thought it was not going through the full logon process - when I was debugging, the login > token generation steps worked flawless every time, but when running, I never generated a session. I tried using allow_redirects in the httpx post, but that did not do it. So here's the hacky fix - add a .2 second delay (this is the shortest, I tried everything else) when we login to enlighten before gathering a token from their web service. If you know of a better way, lets use that instead, but this seems to work reliably.

jrutski commented 2 years ago

Requesting pull

jrutski commented 2 years ago

Close...no sleep.