trezor-core/src/trezor/pin.py

13 lines
388 B
Python
Raw Normal View History

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