Move battery charge to v2 endpoint

This commit is contained in:
Linus Dietz
2023-11-20 18:34:57 +01:00
parent 3be0a4edbf
commit 843e00acd1
2 changed files with 3 additions and 4 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
from config import settings
VERSION = "v1.8.14"
VERSION = "v1.8.15"
OAUTH_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2"
VEHICLES_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles"
@@ -16,7 +16,7 @@ ODOMETER_STATE_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0
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"
ENGINE_STATE_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/engine-status"
BATTERY_CHARGE_STATE_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles/{0}/battery-charge-level"
BATTERY_CHARGE_STATE_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/fuel"
FUEL_STATE_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/fuel"
STATISTICS_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/statistics"
ENGINE_DIAGNOSTICS_URL = "https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/engine"
+1 -2
View File
@@ -265,8 +265,7 @@ def update_car_data(force_update=False, overwrite={}):
def update_ha_device(entity, vin, state):
icon_config = icon_states.get(entity["id"])
if icon_config and state:
if state.replace(".", "").isnumeric():
state = float(state)
if isinstance(state, float):
icon = util.get_icon_between(icon_config, state)
else:
icon = icon_config[state]