Skip to content

Conversation

@allenporter
Copy link
Contributor

@allenporter allenporter commented Dec 24, 2025

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

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.
Copilot AI review requested due to automatic review settings December 24, 2025 02:41
Copy link
Contributor

Copilot AI left a 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 UnsupportedDeviceError exception 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.

@Lash-L
Copy link
Collaborator

Lash-L commented Dec 24, 2025

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

@allenporter
Copy link
Contributor Author

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

I've updated this to include the entire product model

@allenporter allenporter merged commit 7e40857 into Python-roborock:main Dec 24, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants