mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-03 13:22:33 +00:00

Operations possible: check, refresh, wipe, copy. Test coverage only on Unit test level atm. WIP - many TODOs remaining, Device tests not yet done, more error handling necessary.
37 lines
1.0 KiB
Python
37 lines
1.0 KiB
Python
from typing import TYPE_CHECKING
|
|
from . import messages
|
|
from .tools import expect, session
|
|
|
|
if TYPE_CHECKING:
|
|
from .client import TrezorClient
|
|
from .protobuf import MessageType
|
|
|
|
|
|
@expect(messages.SdCardBackupHealth)
|
|
@session
|
|
def check(client: "TrezorClient") -> "MessageType":
|
|
return client.call(
|
|
messages.SdCardBackupManage(operation=messages.SdCardBackupManageOperationType.CHECK)
|
|
)
|
|
|
|
@expect(messages.Success)
|
|
@session
|
|
def refresh(client: "TrezorClient") -> "MessageType":
|
|
return client.call(
|
|
messages.SdCardBackupManage(operation=messages.SdCardBackupManageOperationType.REFRESH)
|
|
)
|
|
|
|
@expect(messages.Success)
|
|
@session
|
|
def wipe(client: "TrezorClient") -> "MessageType":
|
|
return client.call(
|
|
messages.SdCardBackupManage(operation=messages.SdCardBackupManageOperationType.WIPE)
|
|
)
|
|
|
|
@expect(messages.Success)
|
|
@session
|
|
def copy(client: "TrezorClient") -> "MessageType":
|
|
return client.call(
|
|
messages.SdCardBackupManage(operation=messages.SdCardBackupManageOperationType.COPY)
|
|
)
|