-
Notifications
You must be signed in to change notification settings - Fork 61
Update trait refresh method to return None
#586
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
Conversation
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 updates the refresh() method across all trait classes to return None instead of Self, eliminating an unused return value that was causing typing issues. The change simplifies the API by making it clear that refresh() modifies the trait instance in-place rather than returning a new or updated instance.
- Updated the base
refresh()method inV1TraitMixinto returnNone - Removed
return selfstatements from all trait implementations - Updated test to no longer capture the return value from
refresh()
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| roborock/devices/traits/v1/common.py | Base trait implementation updated to return None instead of Self, removed return statement |
| roborock/devices/traits/v1/network_info.py | Updated refresh() return type to None, removed Self import, added pylint disable comment |
| roborock/devices/traits/v1/home.py | Updated refresh() return type to None and removed return statements |
| roborock/devices/traits/v1/device_features.py | Updated refresh() return type to None, removed Self import, adjusted super().refresh() call, added pylint disable comment |
| roborock/devices/traits/v1/clean_summary.py | Updated refresh() return type to None, removed return statements, removed try-except block in _parse_clean_record_response() |
| tests/devices/traits/v1/test_rooms.py | Updated test to call refresh() without capturing return value, use trait instance directly |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The return value is currently not used and just causes typing issues. This is followup from discussion in #580