1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 01:18:28 +00:00

trezorctl: add passphrase_source handling to apply_settings

This commit is contained in:
Pavol Rusnak 2018-03-12 15:14:13 +01:00
parent 3ac96f5b00
commit a0dd3ee502
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 10 additions and 1 deletions

View File

@ -203,6 +203,13 @@ def set_label(connect, label):
return connect().apply_settings(label=label)
@cli.command(help='Set passphrase source.')
@click.argument('source', type=int)
@click.pass_obj
def set_passphrase_source(connect, source):
return connect().apply_settings(passphrase_source=source)
@cli.command(help='Set device flags.')
@click.argument('flags')
@click.pass_obj

View File

@ -643,7 +643,7 @@ class ProtocolMixin(object):
@field('message')
@expect(proto.Success)
def apply_settings(self, label=None, language=None, use_passphrase=None, homescreen=None):
def apply_settings(self, label=None, language=None, use_passphrase=None, homescreen=None, passphrase_source=None):
settings = proto.ApplySettings()
if label is not None:
settings.label = label
@ -653,6 +653,8 @@ class ProtocolMixin(object):
settings.use_passphrase = use_passphrase
if homescreen is not None:
settings.homescreen = homescreen
if passphrase_source is not None:
settings.passphrase_source = passphrase_source
out = self.call(settings)
self.init_device() # Reload Features