Dielee / volvo2mqtt

Home Assistant addon for connecting AAOS Volvos
MIT License
127 stars 25 forks source link

KeyError: 'CHARGING_SYSTEM_SCHEDULED' #153

Closed dominikmicuta closed 6 months ago

dominikmicuta commented 6 months ago

Describe the bug I configured the addon, it works for some time but then I noticed this in logs. I tried to restart it and again it worked for some time until it happened again `Jan 04 17:14:05 volvo2mqtt [107] - INFO: Sending mqtt update... Traceback (most recent call last): File "/volvoAAOS2mqtt/main.py", line 16, in update_loop() File "/volvoAAOS2mqtt/mqtt.py", line 219, in update_loop update_car_data() File "/volvoAAOS2mqtt/mqtt.py", line 255, in update_car_data state = volvo.api_call(entity["url"], "GET", vin, entity["id"], force_update) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/volvoAAOS2mqtt/volvo.py", line 382, in api_call return parse_api_data(data, sensor_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/volvoAAOS2mqtt/volvo.py", line 457, in parse_api_data charging_system_state = charging_system_states[data["chargingSystemStatus"]["value"]]


KeyError: 'CHARGING_SYSTEM_SCHEDULED'`

**To Reproduce**:<br>
Steps to reproduce the behavior:
1. Set charging hours in Volvo app from 23:00 -> 7:00
2. Insert charger into a car at 17:14:05
3. Observe next update in logs
4. No further updates are done

**Expected behavior**:<br>
There should be no crash OR it should auto fix if the crash happens

**Version info**:<br>
1.8.20
Dielee commented 6 months ago

Please update to latest release!

EDIT: Duplicate of #152

dominikmicuta commented 6 months ago

I must have been blind to not see that in closed.