-
Notifications
You must be signed in to change notification settings - Fork 56
fix: Allow startup with unsupported devices #707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Allow startup with unsupported devices #707
Conversation
Raise and catch when finding an unsupported device. We will allow the device manager to continue with the devices that are supported, ignoring the ones that are not supoprted. We test with an unsupported protocol version but it also applies to unsupported q10 devices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the device manager to gracefully handle unsupported devices, allowing the system to continue operating with supported devices while logging and tracking unsupported ones. Previously, encountering an unsupported device would raise NotImplementedError and potentially halt initialization.
Key Changes:
- Introduced
UnsupportedDeviceErrorexception to distinguish unsupported devices from other errors - Added try-catch logic in device discovery to skip unsupported devices and continue with supported ones
- Added diagnostics tracking to monitor counts of supported and unsupported devices by protocol version
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
roborock/devices/device_manager.py |
Adds UnsupportedDeviceError exception class, wraps device creation in try-catch to handle unsupported devices gracefully, and adds diagnostics counters for supported/unsupported devices |
tests/devices/test_device_manager.py |
Adds test case validating that the device manager can handle mixed supported and unsupported devices, verifying only supported devices are initialized and diagnostics are properly tracked |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
my GitHub app has been on the fritz recently, it won’t let me comment on the actual line, but while you’re there could you fix the unsupported device message? I did strip instead of split on accident |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
I've updated this to include the entire product model |
Raise and catch when finding an unsupported device. We will allow the device manager to continue with the devices that are supported, ignoring the ones that are not supoprted.
We test with an unsupported protocol version but it also applies to unsupported q10 devices.
Issue: home-assistant/core#159656