Move vehicles details endpoint to v2 // Try to fix #131

This commit is contained in:
Linus Dietz
2023-11-21 13:59:47 +01:00
parent cb10fe07c3
commit 126cc37269
4 changed files with 15 additions and 2 deletions
+4
View File
@@ -270,8 +270,12 @@ 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:
logging.debug("Entity " + entity["id"] + " state " + str(state))
if isinstance(state, float):
icon = util.get_icon_between(icon_config, state)
elif state.replace(".", "").isnumeric():
state = float(state)
icon = util.get_icon_between(icon_config, state)
else:
icon = icon_config[state]
else: