Conversation
This commit removes all unnecessary custom classes in favor of using standard python exceptions or DeviceExceptions: * Invalid input values are now reported using TypeErrors and ValueErrors * UnsupportedFeatureException gets raised if the device does not support the wanted feature Most of of the downstream users are hopefully catching DeviceExceptions for error handling so this change requires no further action.
Codecov Report
@@ Coverage Diff @@
## master #1558 +/- ##
==========================================
- Coverage 81.05% 80.94% -0.11%
==========================================
Files 154 154
Lines 15073 14987 -86
Branches 3697 3661 -36
==========================================
- Hits 12217 12131 -86
Misses 2609 2609
Partials 247 247
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
@rytilahti Was trying to test the master branch in Home Assistant and traced an error back to this PR: Obviously I know this hasn't been released yet, but since I didn't see |
|
@shbatm Thanks for the reminder, I'm aware of the issue. The current master has diverged much from the one used by homeassistant to make the library more robust and easier to extend (related to #1495). This will necessitate a major refactoring of the integration which will also get rid of the direct imports inside homeassistant codebase to make it more maintainable, so this should be a non-issue in the future. |
Breaking change: all custom
DeviceExceptionderived classes are removed in favor of standard python exceptions and pure DeviceException instances.This commit removes all unnecessary custom classes in favor of using standard python exceptions or DeviceExceptions:
UnsupportedFeatureExceptiongets now raised if the device does not support the wanted featureMost downstream users are hopefully catching DeviceExceptions for error handling so this change requires no further action.
The full list of removed exception classes: