From f1953e1baacedf82dc584d7423b920bb46f77942 Mon Sep 17 00:00:00 2001 From: Linus Dietz <45101649+Dielee@users.noreply.github.com> Date: Fri, 10 Nov 2023 09:21:00 +0100 Subject: [PATCH] Quality optimizations --- src/CHANGELOG.md | 6 ++++++ src/config.yaml | 2 +- src/const.py | 4 ++-- src/volvo.py | 5 ----- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index 6182fcc..167277e 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,3 +1,9 @@ +## v1.8.11 +### 🐛 Bug Fixes: + +- Remove old code from checks for running engine sensor +- Move battery charge level sensor from v2 to v1, as v2 returns 404 + ## v1.8.10 ### 🐛 Bug Fixes: diff --git a/src/config.yaml b/src/config.yaml index 2ec8dfe..be6d0dd 100644 --- a/src/config.yaml +++ b/src/config.yaml @@ -1,6 +1,6 @@ name: "Volvo2Mqtt" description: "Volvo AAOS MQTT bridge" -version: "1.8.10" +version: "1.8.11" slug: "volvo2mqtt" init: false url: "https://github.com/Dielee/volvo2mqtt" diff --git a/src/const.py b/src/const.py index 2363ced..5aab980 100644 --- a/src/const.py +++ b/src/const.py @@ -1,6 +1,6 @@ from config import settings -VERSION = "v1.8.10" +VERSION = "v1.8.11" OAUTH_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2" VEHICLES_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles" @@ -16,7 +16,7 @@ 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/v2/vehicles/{0}/battery-charge-level" +BATTERY_CHARGE_STATE_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles/{0}/battery-charge-level" 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" diff --git a/src/volvo.py b/src/volvo.py index da6bff1..09eaef9 100644 --- a/src/volvo.py +++ b/src/volvo.py @@ -245,11 +245,6 @@ def check_supported_endpoints(): # If battery charge level could be found in recharge-api, skip the second battery charge sensor continue - if entity["id"] == "engine_state" and entity["url"] == ENGINE_DIAGNOSTICS_URL \ - and any("engine_state" in d["id"] for d in supported_endpoints[vin]): - # If engine state could be found in engine state endpoint, skip the second engine running sensor - continue - if entity.get('url'): state = api_call(entity["url"], "GET", vin, entity["id"]) else: