Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,15 @@ async def generate_command_arguments(
else:
arguments.append(f"--commissioning-method {pairing_mode}")

if pairing_mode == DutPairingModeEnum.BLE_WIFI:
arguments.append(f"--wifi-ssid {config.network.wifi.ssid}")
arguments.append(f"--wifi-passphrase {config.network.wifi.password}")

if (
pairing_mode == DutPairingModeEnum.BLE_THREAD
or pairing_mode == DutPairingModeEnum.NFC_THREAD
):
dataset_hex = await __thread_dataset_hex(config.network.thread)
arguments.append(f"--thread-dataset-hex {dataset_hex}")
if pairing_mode == DutPairingModeEnum.BLE_WIFI:
arguments.append(f"--wifi-ssid {config.network.wifi.ssid}")
arguments.append(f"--wifi-passphrase {config.network.wifi.password}")
elif (
pairing_mode == DutPairingModeEnum.BLE_THREAD
or pairing_mode == DutPairingModeEnum.NFC_THREAD
):
Comment on lines +88 to +91

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For better readability and to use a more Pythonic approach, you can check for membership in a tuple or set instead of using multiple or conditions. This makes the code more concise and easier to understand.

    elif pairing_mode in (DutPairingModeEnum.BLE_THREAD, DutPairingModeEnum.NFC_THREAD):

dataset_hex = await __thread_dataset_hex(config.network.thread)
arguments.append(f"--thread-dataset-hex {dataset_hex}")

# Retrieve arguments from test_parameters
if test_parameters:
Expand Down
Loading