-
-
Notifications
You must be signed in to change notification settings - Fork 650
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
Add com port option in Braille Display Select Dialog and fix Serial Connection error #16340
Conversation
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Co-authored-by: Cyrille Bougot <cyrille.bougot2@laposte.net>
See test results for failed build of commit 0b6320011c |
|
@LeonarddeR
Given these issues, there is a need for a software solution. Consequently, my current plan is to modify the code to check via Serial if HID is connectable in software terms. Would this be acceptable? |
If you could come up with a solution that doesn't touch ordering for other drivers, feel free to give it a try, though I"m afraid that it will be almost impossible to do so given how the detection system functions. |
@LeonarddeR |
@EdKweon I've looked briefly at the code and what you're trying to do seems doable but difficult. Here is how I'd go about de-prioritizing HID for a particular driver:
Comments are appreciated. |
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
@seanbudd
|
@EdKweon - you may need to uncollapse hidden comments. search the page for "6 hidden conversations" |
Alternatively, open the PR files page, select conversations, and check through the unresolved comments |
@EdKweon - this is looking almost ready other than the last comment. can you do a final round of testing? @coderabbitai full review |
@seanbudd, I've reviewed the PR based on the available information and discussions in the comments. Here are the key points and recommendations:
Please ensure these areas are addressed comprehensively before finalizing the PR. If there are any specific areas you would like further in-depth analysis or testing on, let me know! Analysis chainScripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Fetch the latest commits and show the changes in the files bdDetect.py and hims.py
git log -p -2 -- bdDetect.py hims.py
Length of output: 1688 Actions performedFull review triggered. |
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.
Actionable comments posted: 4
Outside diff range and nitpick comments (8)
source/brailleDisplayDrivers/hims.py (3)
Line range hint
318-318
: Remove unused loop variable.The loop variable
i
is not used within the loop body. Consider renaming it to_
to indicate that it's intentionally unused:- for i in range(3): + for _ in range(3):
Line range hint
338-339
: Optimize string formatting using f-strings.Use Python's f-string for better readability and performance:
- log.info("Found {device} connected via {type} ({port})".format( - device=self._model.name, type=portType, port=port)) + log.info(f"Found {self._model.name} connected via {portType} ({port})")
Line range hint
364-364
: Use Python's built-in exception type for consistency.Replace
WindowsError
with Python's built-inOSError
for better consistency and clarity:- except WindowsError: + except OSError:source/bdDetect.py (5)
Line range hint
30-30
: Remove unused import oftyping.Set
.- from typing import Set
Line range hint
33-33
: Remove unused import oftyping.Union
.- from typing import Union
Line range hint
151-155
: Remove extraneous parentheses to simplify expression.- usbHidDeviceMatches, usbHidDeviceMatchesForCustom = itertools.tee(( + usbHidDeviceMatches, usbHidDeviceMatchesForCustom = itertools.tee(
Line range hint
217-221
: Remove extraneous parentheses to simplify expression.- btHidDevMatchesForHid, btHidDevMatchesForCustom = itertools.tee(( + btHidDevMatchesForHid, btHidDevMatchesForCustom = itertools.tee(
Line range hint
367-368
: Replaceyield
overfor
loop withyield from
for cleaner and more efficient code.- for driver, match in btDevs: - yield (driver, match) + yield from btDevs
Thanks @EdKweon |
Link to issue number:
Summary of the issue:
Add com port in Hims Braille Display and fix Serial Connection error
Description of user facing changes
Description of development approach
Testing strategy:
Lint, System, Unit
Known issues with pull request:
Code Review Checklist:
Summary by CodeRabbit
New Features
Enhancements
Bug Fixes