1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-14 03:30:02 +00:00

TEST: poll ble events

This commit is contained in:
tychovrahe 2023-04-04 16:16:02 +02:00
parent b2735919cb
commit 9aa63d972f

View File

@ -80,8 +80,22 @@ class Homescreen(HomescreenBase):
self.layout.paint()
ui.refresh()
async def ble_checker_task(self) -> None:
from trezor import io, loop
blecheck = loop.wait(io.BLE_CHECK)
while True:
is_connected = await blecheck
self.layout.usb_event(is_connected)
self.layout.paint()
ui.refresh()
def create_tasks(self) -> Tuple[loop.AwaitableTask, ...]:
return super().create_tasks() + (self.usb_checker_task(),)
return (
super().create_tasks()
+ (self.usb_checker_task(),)
+ (self.ble_checker_task(),)
)
class Lockscreen(HomescreenBase):