最后终于搜过到作者的库中有位大佬moonsn提交了一个 pull , “fix: adapt new version of homeassistant with jwt version 2.x.x”
用他的“util.py" 替换进去后,重启core,再测试终于log正常了。
2022-03-06 02:18:35 DEBUG (MainThread) [custom_components.havcs.http] expiration [1800],refresh_token:[eyJ0eXAiOiJKV1QiL************]
2022-03-06 02:18:35 DEBUG (MainThread) [custom_components.havcs.http] [http][auth] get access token[eyJ0eXAiOiJKV1QiL************] with default expiration [86400s], try to update expiration param and get new access token through another refresh token request.
2022-03-06 02:18:35 DEBUG (MainThread) [custom_components.havcs.util] [util] set new access token expiration for refresh_token[4b405******]
2022-03-06 02:18:35 DEBUG (MainThread) [custom_components.havcs.http] [http][auth] get new access token[eyJ0eXAiOiJKV1QiL************] with new expiration.
2022-03-06 02:18:35 DEBUG (MainThread) [custom_components.havcs.http] [http][auth] success to deal authorization_code request, return access token.