-
Notifications
You must be signed in to change notification settings - Fork 8
Ignore invalide devices and throw warnings #269
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
base: development
Are you sure you want to change the base?
Ignore invalide devices and throw warnings #269
Conversation
|
Still wait for the next release of FiLiP |
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 upgrades the filip library from version 0.6.1 to 0.7.3 and adapts the code to handle invalid devices returned by the updated API. The changes include updating the dependency, handling device list objects with separate valid and invalid device collections, and code formatting improvements.
Key changes:
- Upgraded filip library from ~0.6.1 to ~0.7.3
- Modified device retrieval to handle invalid devices and display warnings to users
- Applied code formatting improvements across multiple functions
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| app/Entirety/requirements.txt | Updated filip dependency from 0.6.1 to 0.7.3 |
| app/Entirety/devices/views/devices.py | Added handling for invalid devices with user warnings and logging |
| app/Entirety/devices/utils.py | Updated get_devices to use include_invalid parameter and return device_list object; applied code formatting fixes |
Comments suppressed due to low confidence (1)
app/Entirety/devices/utils.py:57
- The docstring still states 'Returns: list of devices' but the function now returns a device_list object with
.devicesand.invalid_devicesattributes. Update the docstring to reflect the actual return type.
Returns:
list of devices
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
app/Entirety/devices/utils.py
Outdated
| device_list = iota_client.get_device_list(include_invalid=True) | ||
| return device_list | ||
|
|
||
| except RuntimeError: | ||
| return [{}] |
Copilot
AI
Oct 29, 2025
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.
The exception handler returns [{}] (a list), but the normal code path now returns device_list (an object with .devices and .invalid_devices attributes). This type mismatch will cause an AttributeError in devices/views/devices.py when trying to access device_list.devices and device_list.invalid_devices if an exception occurs. The exception handler should return an object with the same structure or be updated to handle the error differently.
closes #259