Optimize vcc api key check

This commit is contained in:
linus
2024-09-25 07:39:23 +02:00
parent 0cfb1a9e3f
commit 3f36368773
4 changed files with 18 additions and 4 deletions
+6
View File
@@ -1,5 +1,11 @@
## v1.10.1
### 🚀 Features:
- Optimize logging for vcc-api-key check #238
## v1.10.0 ## v1.10.0
### 🚀 Features: ### 🚀 Features:
- Remove unused multiplier options - Remove unused multiplier options
### 🐛 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.0" version: "1.10.1"
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.0" VERSION = "v1.10.1"
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"
+8
View File
@@ -311,9 +311,17 @@ def check_vcc_api_key(test_key, extended_until=None):
logging.warning("VCCAPIKEY " + test_key + " is extended and will be reusable at: " logging.warning("VCCAPIKEY " + test_key + " is extended and will be reusable at: "
+ format_datetime(extended_until, format="medium", locale=settings["babelLocale"])) + format_datetime(extended_until, format="medium", locale=settings["babelLocale"]))
else: else:
if "error" in data:
logging.warning("VCCAPIKEY " + test_key + " isn't working! " + data["error"]["message"]) logging.warning("VCCAPIKEY " + test_key + " isn't working! " + data["error"]["message"])
else: else:
logging.warning("VCCAPIKEY " + test_key + " isn't working! Statuscode " + str(response.status_code) +
" Message: " + response.text)
else:
if "error" in data:
logging.warning("VCCAPIKEY " + test_key + " isn't working! " + data["error"]["message"]) logging.warning("VCCAPIKEY " + test_key + " isn't working! " + data["error"]["message"])
else:
logging.warning("VCCAPIKEY " + test_key + " isn't working! Statuscode " + str(response.status_code) +
" Message: " + response.text)
return True, extended_until return True, extended_until