From 0951e0f5628775ad69563bb28522cd7fddcbc140 Mon Sep 17 00:00:00 2001 From: Ole Melhus Date: Fri, 27 Aug 2021 12:13:05 +0200 Subject: [PATCH] fix: allow auth using refresh_token --- teslajsonpy/connection.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/teslajsonpy/connection.py b/teslajsonpy/connection.py index 41d3b658..c206dbda 100644 --- a/teslajsonpy/connection.py +++ b/teslajsonpy/connection.py @@ -122,6 +122,10 @@ async def post(self, command, method="post", data=None): auth = await self.refresh_access_token( refresh_token=self.sso_oauth.get("refresh_token") ) + elif self.refresh_token: + auth = await self.refresh_access_token( + refresh_token=self.refresh_token + ) if auth and all( ( auth.get(item)