DavidMStraub / homeconnect

MIT License
31 stars 16 forks source link

api: handle_event: check if event data contains items key #16

Closed Noltari closed 2 years ago

Noltari commented 2 years ago

Fixes the following exception:

Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.9/site-packages/homeconnect/api.py", line 172, in _listen
    self.handle_event(event, appliance)
  File "/usr/local/lib/python3.9/site-packages/homeconnect/api.py", line 189, in handle_event
    d = self.json2dict(event_data["items"])
KeyError: 'items'
DavidMStraub commented 2 years ago

Thanks, looks good!

kroimon commented 2 years ago

I tested this over the last week and it seems to have fixed the issue of the HA integration not updating anymore.

@DavidMStraub Would be great if you could release a new version so the dependency in HA core can be updated.

DavidMStraub commented 2 years ago

Ok! Please ping me if I forget to do it in the next 48h 🙂