Skip to content

Commit

Permalink
ui: augment pairing message for devices with multiple channels
Browse files Browse the repository at this point in the history
  • Loading branch information
pfps committed Oct 8, 2024
1 parent 128ec43 commit 4aada31
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/solaar/cli/pair.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ def notifications_hook(self, n):

else:
receiver.set_lock(False, timeout=timeout)
print("Pairing: turn your new device on (timing out in", timeout, "seconds).")
print("Pairing: Turn your device on or press, hold, and release")
print("a channel button or the channel switch button.")
print("Timing out in", timeout, "seconds.")
pairing_start = time()
patience = 5 # the lock-open notification may come slightly later, wait for it a bit
while receiver.pairing.lock_open or time() - pairing_start < patience:
Expand Down
14 changes: 12 additions & 2 deletions lib/solaar/ui/pair_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,20 @@ def create(receiver):
else:
text = _("Other receivers are only compatible with a few devices.")
text += "\n\n"
text += _("Turn on the device you want to pair.")
text += _("For most devices, turn on the device you want to pair.")
text += _("If the device is already turned on, turn it off and on again.")
text += "\n"
text += _("The device must not be paired with a nearby powered-on receiver.")
text += "\n"
text += _("If the device is already turned on, turn it off and on again.")
text += _(
"For devices with multiple channels, "
"press, hold, and release the button for the channel you wish to pair"
"\n"
"or use the channel switch button to select a channel "
"and then press, hold, and release the channel switch button."
)
text += "\n"
text += _("The channel indicator light should be blinking rapidly.")
if receiver.remaining_pairings() and receiver.remaining_pairings() >= 0:
text += (
ngettext(
Expand Down

0 comments on commit 4aada31

Please sign in to comment.