mirror of
https://github.com/Dielee/volvo2mqtt.git
synced 2026-08-12 18:59:53 +02:00
Add engine state fallback endpoint // Dynamic icons for engine state
This commit is contained in:
+6
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user