* Catch Volvo API not returning a valid json string #104

* Update changelog
This commit is contained in:
Linus Dietz
2023-09-21 14:31:21 +02:00
committed by GitHub
parent 6b419cfe3a
commit 781e1da8e8
4 changed files with 18 additions and 7 deletions
+6 -5
View File
@@ -255,11 +255,12 @@ def update_car_data(force_update=False, overwrite={}):
else:
topic = f"homeassistant/{entity['domain']}/{vin}_{entity['id']}/state"
mqtt_client.publish(
topic,
json.dumps(state) if isinstance(state, dict) or isinstance(state, list) else state
)
update_ha_device(entity, vin, state)
if state:
mqtt_client.publish(
topic,
json.dumps(state) if isinstance(state, dict) or isinstance(state, list) else state
)
update_ha_device(entity, vin, state)
def update_ha_device(entity, vin, state):