Skip to content
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 ID_PATH and DEVNAME as fallbacks for the camera id #74

Merged
merged 3 commits into from
Jan 18, 2024

Conversation

NiklasNeugebauer
Copy link
Contributor

This resolves #69

@NiklasNeugebauer NiklasNeugebauer marked this pull request as ready for review January 18, 2024 09:20
@falkoschindler
Copy link
Contributor

I wonder if we should always use the ID_VENDOR_ID and ID_MODEL_ID, like

parts = [
    device.get('ID_VENDOR_ID'),
    device.get('ID_MODEL_ID'),
    device.get('ID_SERIAL_SHORT') or device.get('ID_PATH') or device.get('DEVNAME'),
]
return '-'.join(parts) if all(parts) or None

🤔

@NiklasNeugebauer
Copy link
Contributor Author

NiklasNeugebauer commented Jan 18, 2024

Added. We might run into the case of these also not being available while just the devpath realistically must be, but lets see if that ever happens

@NiklasNeugebauer
Copy link
Contributor Author

Actually, I added the final "only devname" case

@NiklasNeugebauer NiklasNeugebauer merged commit ff212ca into main Jan 18, 2024
2 checks passed
@NiklasNeugebauer NiklasNeugebauer deleted the generalized_usb_camera_id branch January 18, 2024 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

udev string ID_SERIAL_SHORT might not be available
3 participants