forked from peter/volvo2mqtt
Fix missing local refresh file while loading from filesystem
This commit is contained in:
+1
-1
@@ -12,7 +12,7 @@ CLIMATE_STOP_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/
|
||||
LOCK_STATE_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/doors"
|
||||
CAR_LOCK_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/commands/lock"
|
||||
CAR_UNLOCK_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/commands/unlock"
|
||||
RECHARGE_STATE_URL = "https://api.volvocars.com/energy/v1/vehicles/{0}/recharge-status"
|
||||
RECHARGE_STATE_URL = "https://api.volvocars.com/energy/v2/vehicles/{0}/recharge-status"
|
||||
ODOMETER_STATE_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/odometer"
|
||||
LOCATION_STATE_URL = "https://api.volvocars.com/location/v1/vehicles/{0}/location"
|
||||
TYRE_STATE_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/tyres"
|
||||
|
||||
@@ -197,6 +197,10 @@ def refresh_auth():
|
||||
|
||||
if auth.status_code == 200:
|
||||
token_path = util.get_token_path()
|
||||
if os.path.exists(token_path):
|
||||
with open(token_path) as f:
|
||||
data = json.load(f)
|
||||
|
||||
refresh_data = auth.json()
|
||||
|
||||
if not "refresh_token" in refresh_data:
|
||||
@@ -458,7 +462,9 @@ def check_engine_status(vin):
|
||||
mqtt.assumed_climate_state[vin] = "OFF"
|
||||
mqtt.update_car_data()
|
||||
break
|
||||
|
||||
time.sleep(5)
|
||||
return None
|
||||
|
||||
|
||||
def backend_status_loop():
|
||||
|
||||
Reference in New Issue
Block a user