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:
parent
6cc879deea
commit
89d9c1f816
@ -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()
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user