Dielee / volvo2mqtt

Home Assistant addon for connecting AAOS Volvos
MIT License
163 stars 38 forks source link

Addon crashes every now and then #104

Closed lancer73 closed 1 year ago

lancer73 commented 1 year ago

Describe the bug Sometimes (once per week) the addon crashes due to an unexpected reply from the Volvo services.

To Reproduce:
Steps to reproduce the behavior:

  1. Wait long enough

Expected behavior:
The addon handles the exception gracefully

Version info:
1.8.7 using Home Assistant addon mechanism

Logs:
Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/requests/models.py", line 971, in json return complexjson.loads(self.text, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/json/init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/volvoAAOS2mqtt/main.py", line 16, in update_loop() File "/volvoAAOS2mqtt/mqtt.py", line 220, in update_loop update_car_data() File "/volvoAAOS2mqtt/mqtt.py", line 251, in update_car_data state = volvo.api_call(entity["url"], "GET", vin, entity["id"], force_update) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/volvoAAOS2mqtt/volvo.py", line 350, in api_call data = response.json() ^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/requests/models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Dielee commented 1 year ago

This an Volvo API issue... I will take a look if this is fixable.

lancer73 commented 1 year ago

I see your new version in GitHub (1.8.8) only HA still sees 1.8.7 as the latest. Something wrong on my side?

Dielee commented 1 year ago

Jep, my fault, you're right. I will fix this.