1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-07 14:00:57 +00:00

fix(trezorlib): fox ping command, add ping to session

[no changelog]
This commit is contained in:
M1nd3r 2024-11-28 17:59:56 +01:00
parent 6cc879deea
commit 89d9c1f816
2 changed files with 7 additions and 3 deletions

View File

@ -337,9 +337,7 @@ def ping(session: "Session", message: str, button_protection: bool) -> str:
"""Send ping message."""
# TODO return short-circuit from old client for old Trezors
return session.call(
messages.Ping(message=message, button_protection=button_protection)
)
return session.ping(message, button_protection)
@cli.command()

View File

@ -73,6 +73,12 @@ class Session:
def end(self) -> t.Any:
return self.call(messages.EndSession())
def ping(self, message: str, button_protection: bool | None = None) -> str:
resp: messages.Success = self.call(
messages.Ping(message=message, button_protection=button_protection)
)
return resp.message or ""
@property
def features(self) -> messages.Features:
return self.client.features