Compare commits

...
1 Commits
Author SHA1 Message Date
linus 75013509f4 Fix re-auth with OTP while app runtime #251 2024-10-26 18:27:29 +02:00
4 changed files with 10 additions and 2 deletions
+6
View File
@@ -1,3 +1,9 @@
## v1.10.3
### 🐛 Bug Fixes:
- Add more info logging for credential refresh process
- Fix bug if app needs to be re-authenticated with OTP while runtime
## v1.10.2 ## v1.10.2
### 🐛 Bug Fixes: ### 🐛 Bug Fixes:
+1 -1
View File
@@ -1,6 +1,6 @@
name: "Volvo2Mqtt" name: "Volvo2Mqtt"
description: "Volvo AAOS MQTT bridge" description: "Volvo AAOS MQTT bridge"
version: "1.10.2" version: "1.10.3"
slug: "volvo2mqtt" slug: "volvo2mqtt"
init: false init: false
url: "https://github.com/Dielee/volvo2mqtt" url: "https://github.com/Dielee/volvo2mqtt"
+1 -1
View File
@@ -1,6 +1,6 @@
from config import settings from config import settings
VERSION = "v1.10.2" VERSION = "v1.10.3"
OAUTH_TOKEN_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2" OAUTH_TOKEN_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2"
OAUTH_AUTH_URL = "https://volvoid.eu.volvocars.com/as/authorization.oauth2" OAUTH_AUTH_URL = "https://volvoid.eu.volvocars.com/as/authorization.oauth2"
+2
View File
@@ -162,6 +162,7 @@ def send_otp(auth_session, data):
auth = auth_session.post(next_url, data=json.dumps(body)) auth = auth_session.post(next_url, data=json.dumps(body))
if auth.status_code == 200: if auth.status_code == 200:
mqtt.otp_code = None
return auth.json() return auth.json()
else: else:
message = auth.json() message = auth.json()
@@ -198,6 +199,7 @@ def refresh_auth():
token_expires_at = datetime.now(util.TZ) + timedelta(seconds=(data["expires_in"] - 30)) token_expires_at = datetime.now(util.TZ) + timedelta(seconds=(data["expires_in"] - 30))
refresh_token = data["refresh_token"] refresh_token = data["refresh_token"]
else: else:
logging.warning("Refreshing credentials failed!: " + str(auth.status_code) + " Message: " + auth.text)
authorize(renew_tokenfile=True) authorize(renew_tokenfile=True)