Skip to content

Commit

Permalink
if no device discovered, ask if rescan for all devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Psychokiller1888 committed Jul 30, 2022
1 parent 5c83b9b commit 597f27b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions AliceCli/utils/commons.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,19 @@ def discover(ctx: click.Context, network: str, all_devices: bool, return_to_main

stopAnimation()

if not devices and not all_devices:
choice = inquirer.confirm(
message='No Project Alice standard device found, do you want to rescan for every devices?',
default=False
).execute()

if choice:
ctx.invoke(discover, network=network, all_devices=True, return_to_main_menu=return_to_main_menu)
return
else:
returnToMainMenu(ctx)


devices.append('Return to main menu') # NOSONAR
device = inquirer.select(
message='Select the device you want to connect to',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

setup(
name='projectalice-cli',
version='1.3.27',
version='1.3.28',
long_description=Path('README.md').read_text(encoding='utf8'),
long_description_content_type='text/markdown',
python_requires='>=3.8',
Expand Down

0 comments on commit 597f27b

Please sign in to comment.