diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index c596987..d8ef401 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,3 +1,10 @@ +## v1.7.3 +### 🐛 Bug Fixes: + +- Fixed API changes from Volvo #53 + +ATTENTION: Volvo optimized their API. Maybe you have to set your odometer multiplier to 1. +Also check all the other multipliers! ## v1.7.2 ### 🐛 Bug Fixes: diff --git a/src/config.yaml b/src/config.yaml index b20d745..7bde1ba 100644 --- a/src/config.yaml +++ b/src/config.yaml @@ -1,6 +1,6 @@ name: "Volvo2Mqtt" description: "Volvo AAOS MQTT bridge" -version: "1.7.2" +version: "1.7.3" slug: "volvo2mqtt" init: false url: "https://github.com/Dielee/volvo2mqtt" diff --git a/src/const.py b/src/const.py index 8947059..7db7803 100644 --- a/src/const.py +++ b/src/const.py @@ -1,6 +1,6 @@ from config import settings -VERSION = "v1.7.2" +VERSION = "v1.7.3" OAUTH_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2" VEHICLES_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles" diff --git a/src/volvo.py b/src/volvo.py index 572c702..35eb03c 100644 --- a/src/volvo.py +++ b/src/volvo.py @@ -369,7 +369,7 @@ def parse_api_data(data, sensor_id=None): return engine_states[data["engineRunning"]["value"]] if util.keys_exists(data, "engineRunning") else None elif sensor_id == "fuel_level": if util.keys_exists(data, "fuelAmount"): - fuel_amount = int(data["fuelAmount"]["value"]) + fuel_amount = float(data["fuelAmount"]["value"]) if fuel_amount > 0: return fuel_amount return None @@ -388,7 +388,7 @@ def parse_api_data(data, sensor_id=None): return None elif sensor_id == "average_speed": if util.keys_exists(data, "averageSpeed"): - average_speed = int(data["averageSpeed"]["value"]) + average_speed = float(data["averageSpeed"]["value"]) if average_speed > 1: divider = 1 if util.keys_exists(settings["volvoData"], "averageSpeedDivider"):