Skip to content

fix: re-enable add udev rule functionality #125

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

robberwick
Copy link
Collaborator

This pull request includes changes to the src/scripts/main.py file to re-enable the --add-udev-rule functionality in the blinkstick cli tool, and improve the clarity of help messages. The most important changes include updating the help text for the --add-udev-rule option and reordering the logic for finding BlinkStick devices based on serial numbers.

Improvements to help messages:

  • Updated the help text for the --add-udev-rule option to include an example command for running it with root permissions.

Code reorganization:

  • Moved the logic for adding the udev rule to a more appropriate location in the main function, ensuring it is executed before any actions which require finding BlinkStick devices

Re-enable to --add-udev-rule functionality in the blinkstick cli tool,
@robberwick robberwick requested a review from Copilot February 23, 2025 10:52
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

sticks = [find_by_serial(options.serial)]

if len(sticks) == 0:
print("BlinkStick with serial number " + options.backend + " not found...")
Copy link
Preview

Copilot AI Feb 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message incorrectly references 'options.backend' instead of 'options.serial'. Please update the variable to correctly reflect the intended serial number usage.

Suggested change
print("BlinkStick with serial number " + options.backend + " not found...")
print("BlinkStick with serial number " + options.serial + " not found...")

Copilot uses AI. Check for mistakes.

@robberwick robberwick requested a review from Copilot February 23, 2025 10:54
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

src/scripts/main.py:307

  • The error message now correctly uses options.serial instead of the previously incorrect options.backend. Please confirm that all references to the old variable have been updated.
print("BlinkStick with serial number " + options.serial + " not found...")

src/scripts/main.py:280

  • When both --add-udev-rule and a serial filter are provided, the udev branch will be executed and the device search skipped. Please verify that this behavior is intended and clearly documented in the help messages.
if options.udev:

@robberwick robberwick merged commit 9581125 into arvydas:release/2.0-dev Feb 23, 2025
17 checks passed
@robberwick robberwick deleted the release/fix-main-script-add-udev-rule branch February 23, 2025 10:58
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.

1 participant