1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-04-16 15:25:47 +00:00

fix(core): make ble_event upy api function optional

[no changelog]
This commit is contained in:
tychovrahe 2025-03-27 19:10:44 +01:00 committed by TychoVrahe
parent 4adf6d087d
commit 1fc6feda80
2 changed files with 7 additions and 5 deletions

View File

@ -1062,15 +1062,16 @@ pub static mp_module_trezorui_api: Module = obj_module! {
/// def button_event(self, event: int, button: int) -> LayoutState | None:
/// """Receive a button event `event` for button `button`."""
///
/// if utils.USE_BLE:
/// def ble_event(self, event: int, data: bytes) -> LayoutState | None:
/// """Receive a BLE events."""
///
/// def progress_event(self, value: int, description: str) -> LayoutState | None:
/// """Receive a progress event."""
///
/// def usb_event(self, connected: bool) -> LayoutState | None:
/// """Receive a USB connect/disconnect event."""
///
/// def ble_event(self, event: tuple[int, int | None]) -> LayoutState | None:
/// """Receive a BLE event."""
///
/// def timer(self, token: int) -> LayoutState | None:
/// """Callback for the timer set by `attach_timer_fn`.
///

View File

@ -22,12 +22,13 @@ class LayoutObj(Generic[T]):
if utils.USE_BUTTON:
def button_event(self, event: int, button: int) -> LayoutState | None:
"""Receive a button event `event` for button `button`."""
if utils.USE_BLE:
def ble_event(self, event: int, data: bytes) -> LayoutState | None:
"""Receive a BLE events."""
def progress_event(self, value: int, description: str) -> LayoutState | None:
"""Receive a progress event."""
def usb_event(self, connected: bool) -> LayoutState | None:
"""Receive a USB connect/disconnect event."""
def ble_event(self, event: tuple[int, int | None]) -> LayoutState | None:
"""Receive a BLE event."""
def timer(self, token: int) -> LayoutState | None:
"""Callback for the timer set by `attach_timer_fn`.
This function should be called by the executor after the corresponding