This commit is contained in:
Linus Dietz
2024-01-23 08:42:37 +01:00
parent 9c749001c9
commit ce856d91c4
+5 -1
View File
@@ -265,7 +265,11 @@ def update_car_data(force_update=False, overwrite={}):
f"homeassistant/{entity['domain']}/{vin}_{entity['id']}/attributes",
json.dumps(state)
)
state = sum(value == "FAILURE" for value in state.values())
if state:
state = sum(value == "FAILURE" for value in state.values())
else:
state = 0
topic = f"homeassistant/{entity['domain']}/{vin}_{entity['id']}/state"
else:
topic = f"homeassistant/{entity['domain']}/{vin}_{entity['id']}/state"