From 3b138b4f98b9af8b9e5816d7c910b3ea36419d15 Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Sun, 4 Oct 2020 23:43:01 +0200 Subject: [PATCH] feat(python): add experimental_features setting --- python/src/trezorlib/cli/settings.py | 11 +++++++++++ python/src/trezorlib/device.py | 2 ++ 2 files changed, 13 insertions(+) diff --git a/python/src/trezorlib/cli/settings.py b/python/src/trezorlib/cli/settings.py index 88319c7f6f..4f9b90fb52 100644 --- a/python/src/trezorlib/cli/settings.py +++ b/python/src/trezorlib/cli/settings.py @@ -210,6 +210,17 @@ def safety_checks(client, always, level): return device.apply_settings(client, safety_checks=level) +@cli.command() +@click.argument("enable", type=ChoiceType({"on": True, "off": False})) +@with_client +def experimental_features(client, enable): + """Enable or disable experimental message types. + + This is a developer feature. Use with caution. + """ + return device.apply_settings(client, experimental_features=enable) + + # # passphrase operations # diff --git a/python/src/trezorlib/device.py b/python/src/trezorlib/device.py index 60a1335b31..2179cd19be 100644 --- a/python/src/trezorlib/device.py +++ b/python/src/trezorlib/device.py @@ -36,6 +36,7 @@ def apply_settings( auto_lock_delay_ms=None, display_rotation=None, safety_checks=None, + experimental_features=None, ): settings = messages.ApplySettings( label=label, @@ -46,6 +47,7 @@ def apply_settings( auto_lock_delay_ms=auto_lock_delay_ms, display_rotation=display_rotation, safety_checks=safety_checks, + experimental_features=experimental_features, ) out = client.call(settings)