1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-17 01:52:02 +00:00

apps/homescreen: fix backlight

This commit is contained in:
Jan Pochyla 2017-11-03 11:49:41 +01:00
parent 8342aa2e7d
commit 278610dce1

View File

@ -16,7 +16,8 @@ async def dim_screen():
await loop.sleep(10000000) await loop.sleep(10000000)
def display_homescreen(): @ui.layout
async def display_homescreen():
from apps.common import storage from apps.common import storage
image = res.load('apps/homescreen/res/trezor_lock.toig') image = res.load('apps/homescreen/res/trezor_lock.toig')
@ -26,14 +27,13 @@ def display_homescreen():
if not storage.is_initialized(): if not storage.is_initialized():
label = 'Go to trezor.io/start' label = 'Go to trezor.io/start'
else: else:
label = storage.get_label() label = storage.get_label() or 'My TREZOR'
if not label:
label = 'My TREZOR'
ui.display.text_center(ui.SCREEN // 2, ui.SCREEN - 20, label, ui.BOLD, ui.FG, ui.BG) ui.display.text_center(ui.SCREEN // 2, ui.SCREEN - 20, label, ui.BOLD, ui.FG, ui.BG)
await dim_screen()
@unimport @unimport
async def layout_homescreen(): async def layout_homescreen():
while True: while True:
display_homescreen() await loop.wait(swipe_to_rotate(), display_homescreen())
await loop.wait(swipe_to_rotate(), dim_screen())