Skip to content

Commit

Permalink
Optimize vcc api key check
Browse files Browse the repository at this point in the history
  • Loading branch information
Dielee committed Sep 25, 2024
1 parent 0cfb1a9 commit 3f36368
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## v1.10.1
### 🚀 Features:

- Optimize logging for vcc-api-key check #238

## v1.10.0
### 🚀 Features:

- Remove unused multiplier options

### 🐛 Bug Fixes:
Expand Down
2 changes: 1 addition & 1 deletion src/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Volvo2Mqtt"
description: "Volvo AAOS MQTT bridge"
version: "1.10.0"
version: "1.10.1"
slug: "volvo2mqtt"
init: false
url: "https://github.com/Dielee/volvo2mqtt"
Expand Down
2 changes: 1 addition & 1 deletion src/const.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from config import settings

VERSION = "v1.10.0"
VERSION = "v1.10.1"

OAUTH_TOKEN_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2"
OAUTH_AUTH_URL = "https://volvoid.eu.volvocars.com/as/authorization.oauth2"
Expand Down
12 changes: 10 additions & 2 deletions src/volvo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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: "
+ format_datetime(extended_until, format="medium", locale=settings["babelLocale"]))
else:
logging.warning("VCCAPIKEY " + test_key + " isn't working! " + data["error"]["message"])
if "error" in data:
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)
else:
logging.warning("VCCAPIKEY " + test_key + " isn't working! " + data["error"]["message"])
if "error" in data:
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


Expand Down

0 comments on commit 3f36368

Please sign in to comment.