-
Notifications
You must be signed in to change notification settings - Fork 9
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
Device dependent margins/config #54
Changes from 1 commit
d73626d
06f61ea
3aecdc7
1872e40
1b279b3
2353512
dcc6234
040f2c2
f907b8b
d64c977
a7def5e
d8dcb3d
4fc8b68
1d36049
d8b3b6d
13fa9b9
424ec34
d342a04
1786928
16d82e8
e239867
b390217
0bdf8fd
a4ed930
fdf3538
0fa7ad5
7246473
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
from usb.core import NoBackendError, USBError | ||
|
||
from labelle.lib.constants import ( | ||
SUPPORTED_DEVICE_ID, | ||
SUPPORTED_PRODUCTS, | ||
UNCONFIRMED_MESSAGE, | ||
) | ||
|
@@ -82,8 +81,11 @@ def find_and_select_device(self, patterns: list[str] | None = None) -> UsbDevice | |
LOG.debug(dev.device_info) | ||
dev = devices[0] | ||
if dev.is_supported: | ||
msg = f"Recognized device as \ | ||
{SUPPORTED_PRODUCTS[SUPPORTED_DEVICE_ID(dev.id_product)]}" | ||
foundDeviceConfig: DeviceConfig | None = get_device_config_by_id( | ||
dev.id_product | ||
) | ||
if foundDeviceConfig is not None: | ||
msg = f"Recognized device as {foundDeviceConfig.name}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was not sure how to proceed than. Just print nothing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
else: | ||
msg = f"Unrecognized device: {hex(dev.id_product)}. {UNCONFIRMED_MESSAGE}" | ||
LOG.debug(msg) | ||
|
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.
Do you really need to declare the type of
foundDeviceConfig
(I guess you meantfound_device_config
:-) )?If the function declares its return type, then I think it should be fine not to declare here.
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.
Yeah this was an ugly workaround. Will be obsolete when I fix the other function.
And yes of course I meant snake_case 😉
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.
Fixed