'This dialog box should be usable even if the user has
forgotten their PIN or it is in bootloader mode.'

def choose_device(self, window, keystore):

    device_id = self.device_manager().xpub_id(keystore.xpub)
    if (not device_id):
        try:
            info = self.device_manager().select_device(self, keystore.handler, keystore)
        except UserCancelled:
            return
        device_id = info.device.id_
    return device_id
