Add engine state fallback endpoint // Dynamic icons for engine state

This commit is contained in:
Linus Dietz
2023-07-03 07:26:18 +02:00
parent 389be776d0
commit 1998dfc231
2 changed files with 9 additions and 1 deletions
+6 -1
View File
@@ -10,7 +10,7 @@ from babel.dates import format_datetime
from const import charging_system_states, charging_connection_states, door_states, window_states, \
OAUTH_URL, VEHICLES_URL, VEHICLE_DETAILS_URL, RECHARGE_STATE_URL, CLIMATE_START_URL, \
WINDOWS_STATE_URL, LOCK_STATE_URL, TYRE_STATE_URL, supported_entities, BATTERY_CHARGE_STATE_URL, \
STATISTICS_URL, CLIMATE_STOP_URL
STATISTICS_URL, CLIMATE_STOP_URL, ENGINE_DIAGNOSTICS_URL
session = requests.Session()
session.headers = {
@@ -150,6 +150,11 @@ 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: