-
Notifications
You must be signed in to change notification settings - Fork 37
Seed NVMe SMART flags from canonical interface #100
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
Verify nvme from interface instead of name
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 refactors NVMe device detection and SMART capability assignment to use the canonical interface classification instead of early interface-specific defaults. The change ensures that NVMe devices accessed through bridge interfaces like ASMedia are properly flagged as SMART-capable SSDs.
- Removes hardcoded NVMe defaults during device initialization and interface probing
- Adds canonical interface mapping for ASMedia bridge (
sntasmedia→nvme) - Sets SMART flags based on canonical interface during the update process
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pySMART/device.py | Updated device initialization defaults and classification logic |
| pySMART/utils.py | Added sntasmedia interface mapping |
| tests/dataset/singletests/nvme_usb_asmedia_issue_97/device.json | Test data for ASMedia NVMe device |
| tests/dataset/singletests/nvme_usb_asmedia_issue_97/-d_sntasmedia--all__dev_sda | Raw smartctl output for test case |
| tests/dataset/listingtests/linux_usb_nvme_asmedia_issue_97/device.json | Test data for device listing |
| tests/dataset/listingtests/linux_usb_nvme_asmedia_issue_97/-d_sntasmedia--all__dev_sda | Raw smartctl output for listing test |
| tests/dataset/listingtests/linux_usb_nvme_asmedia_issue_97/_--scan-open | Device scan output |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Summary
Testing
|
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
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| canonical_interface = self.dev_interface | ||
| if canonical_interface == 'nvme': | ||
| self.smart_capable = True | ||
| self.smart_enabled = True | ||
| self.is_ssd = True |
Copilot
AI
Oct 1, 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 variable name canonical_interface is misleading since it's assigned self.dev_interface but the comment and PR description suggest it should use the result from _classify(). Either use self._classify() or rename the variable to reflect it's using dev_interface.
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.
@copilot could you fix this for me?
Summary
_classifyduringupdate()to flag NVMe devices (including ASMedia bridges) as SMART-capable SSDs_interfaceshortcut that previously toggled the NVMe defaults during interface probingTesting
https://chatgpt.com/codex/tasks/task_e_68dd1e61b4e0832fa014ceacb486f993