Fix missing local refresh file while loading from filesystem

This commit is contained in:
linus
2025-11-12 14:04:52 +01:00
parent 4673f14a1c
commit f95348769b
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -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"
+6
View File
@@ -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():