Refactor Bluetooth setup and improve configuration wizard #338
+324
−118
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request to
pwnagotchi
includes significant changes to improve the CLI wizard and add Bluetooth functionality. The most important changes include adding DBus imports, refactoring the wizard setup, and adding new helper functions for user input validation and Bluetooth setup.Enhancements to CLI wizard:
pwnagotchi/cli.py
: Added DBus imports to support Bluetooth functionality.pwnagotchi/cli.py
: Refactored the wizard setup to include new helper functions for input validation (ask_yes_no
,ask_non_empty
,ask_positive_int
) and Bluetooth setup (setup_bluetooth_dbus
).pwnagotchi/cli.py
: Added a new functionrun_wizard
to streamline the interactive configuration process, including Bluetooth pairing and display settings.Minor code improvements:
pwnagotchi/automata.py
: Improved comments for clarity in_on_error
method.pwnagotchi/cli.py
: Improved comments for clarity indo_auto_mode
method.Motivation and Context
The wizard breaks every time something wrong was entered and the wizard is only semi-automatic; the bluetooth pairing and trusting is manual.
How Has This Been Tested?
This has been tested from start to finish on Raspberrypi 0wh.
The bluetooth pairing was also tested on other Raspberry Pi devices (4B 8GB) using the following python script:
Important
This script needs to be ran as root (
sudo python3.11 test_auto_bt_dbus.py
)python script
Types of changes
Checklist:
git commit -s