Closed gi11es closed 2 years ago
It seems like close() is getting called prematurely on the Tesla class, which nukes self.adapters. I'll try to track down why.
Nevermind, this was user error on my part. An identation bug in my code where the POST commands were not in the "with teslapy.Tesla" block they should have been in. I guess maybe an older version of the library didn't do the self.adapters cleanup and that's what I was using on the old host?
Yep, I see that this cleanup code was added in 2.6.0, I was probably running 2.5.0 on the old host. So the code in my bug was hidden by the fact that the self.adapters cleanup wasn't happening.
I've moved my code to a new host, and now I get this for POST commands:
I'm running 2.6.0 installed from pip3, python 3.10.4. requests_oauthlib is version 1.3.1
I removed cache.json just in case and redid the authentication, I still get the same error.
The GET commands are working fine, I'm getting vehicle data, etc. But POST commands result in this error.
It's possible that the host move is unrelated to the bug, as I hadn't run the code on the old host for a few weeks prior to the move.