mirror of
https://github.com/Dielee/volvo2mqtt.git
synced 2026-07-22 02:13:01 +02:00
Fix type error #3 // Add addon version
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
VERSION = "v1.0.2.1"
|
||||
|
||||
OAUTH_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2"
|
||||
VEHICLES_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles"
|
||||
VEHICLE_DETAILS_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles/{0}"
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
from volvo import authorize
|
||||
from mqtt import update_loop, connect
|
||||
from const import VERSION
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("Starting volvo2mqtt version " + VERSION)
|
||||
authorize()
|
||||
connect()
|
||||
update_loop()
|
||||
|
||||
@@ -8,7 +8,7 @@ from const import charging_system_states, CLIMATE_START_URL, \
|
||||
|
||||
session = requests.Session()
|
||||
session.headers = {
|
||||
"vcc-api-key": settings["volvoData"]["vccapikey"],
|
||||
"vcc-api-key": "",
|
||||
"content-type": "application/json",
|
||||
"accept": "*/*"
|
||||
}
|
||||
@@ -42,6 +42,7 @@ def authorize():
|
||||
token_expires_at = datetime.now() + timedelta(seconds=(data["expires_in"] - 30))
|
||||
refresh_token = data["refresh_token"]
|
||||
|
||||
session.headers.update({"vcc-api-key": settings["volvoData"]["vccapikey"]})
|
||||
get_vehicles()
|
||||
else:
|
||||
message = auth.json()
|
||||
|
||||
Reference in New Issue
Block a user