2018-02-05 06:13:33 -08:00
|
|
|
from trezor import ui
|
|
|
|
|
|
|
|
|
|
|
|
def pin_to_int(pin: str) -> int:
|
2017-12-15 12:06:29 -08:00
|
|
|
return int('1' + pin)
|
|
|
|
|
2017-12-15 12:11:46 -08:00
|
|
|
|
2018-02-05 06:13:33 -08:00
|
|
|
def show_pin_timeout(wait: int, total: int):
|
2018-02-22 07:44:46 -08:00
|
|
|
ui.display.bar(0, 0, ui.WIDTH, ui.HEIGHT, ui.BG)
|
2017-12-15 12:06:29 -08:00
|
|
|
ui.display.loader(1000 - (1000 * wait // total), -10, ui.FG, ui.BG)
|
2018-02-22 07:44:46 -08:00
|
|
|
ui.display.text_center(ui.WIDTH // 2, ui.HEIGHT - 20, 'Waiting for %d s' % wait, ui.BOLD, ui.FG, ui.BG)
|
2017-12-15 12:06:29 -08:00
|
|
|
ui.display.refresh()
|