Closed DanielHabenicht closed 1 year ago
Merging this would break reauthentication (at least on v2 shcs). Maybe checking the error code in both code paths will solve both problems?
Do you have a V2? In my mind this should also work in V2 (but with one request more), but I can't test it.
If not we can check it on both code paths.
If you're on this, would you also add a comment that explains the workaround?
Yes I have a v2. This code works, but only for 24 hours. Then the token is expired and the error code is sent (which does not throw an exception). Checking the error code in your case is only done on the second request inside the except block, so the new token will never be refreshed. I don't know if this is the case only for v2 devices as I don't know when the v1s will drop the connection.
got you. I updated the code. It's working on V1.
Although I now get a fair amount of warnings about the ErrorCodeException
and Server disconnected
, but it could also be that I now enabled a higher logging level...
Thanks. I'm merging this but I have to wait a few days until I can test it in my real setup because I made some bigger changes in 1.3.0 that I need to check for stability first.
fix #19
Sorry for the closing and opening again, but I needed to test on my main branch...