rainepretorius / olarm-ha-integration

Integration for Olarm devices created by a BSC(Computer Science and Mathematics) student.
https://raine.pretoriusse.net
BSD 2-Clause "Simplified" License
30 stars 13 forks source link

Use correct exception type #30

Closed drzoidberg33 closed 1 year ago

drzoidberg33 commented 1 year ago

Fixes #29

I spotted the error and it is an easy fix.

drzoidberg33 commented 1 year ago

Thanks, I should just get this project set up in a dev environment so I can help out. I just tested this directly on my HA instance where it appeared to work 😅

drzoidberg33 commented 1 year ago

The class must inherit from BaseException, else it throws an error and does not work.

I'm confused as to what exceptions.py is supposed to be doing here, the comment at the top states it is storing them in the home assistant format - could you point me to the documentation for this?

I'm still unsure how a KeyError exception will get caught here when we have no condition for it.

jonathankretzmer commented 1 year ago

I had the exact same issue, applied the proposed fix from @drzoidberg33, and it's working fine now.

drzoidberg33 commented 1 year ago

This was resolved in https://github.com/rainepretorius/olarm-ha-integration/commit/3577751081fbef44420a3254fb222e1b768ed13a

Thanks @rainepretorius!