|
2 | 2 |
|
3 | 3 | from .commands import backup_device, displayaddress, enumerate, find_device, \ |
4 | 4 | get_client, getmasterxpub, getxpub, getkeypool, getdescriptors, prompt_pin, restore_device, send_pin, setup_device, \ |
5 | | - signmessage, signtx, wipe_device, install_udev_rules |
| 5 | + signmessage, signtx, wipe_device, install_udev_rules, \ |
| 6 | + update_firmware |
6 | 7 | from .errors import ( |
7 | 8 | handle_errors, |
8 | 9 | DEVICE_CONN_ERROR, |
@@ -68,6 +69,9 @@ def send_pin_handler(args, client): |
68 | 69 | def install_udev_rules_handler(args): |
69 | 70 | return install_udev_rules('udev', args.location) |
70 | 71 |
|
| 72 | +def update_firmware_handler(args, client): |
| 73 | + return update_firmware(client, args.file) |
| 74 | + |
71 | 75 | class HWIHelpFormatter(argparse.ArgumentDefaultsHelpFormatter, argparse.RawDescriptionHelpFormatter): |
72 | 76 | pass |
73 | 77 |
|
@@ -181,6 +185,10 @@ def process_commands(cli_args): |
181 | 185 | sendpin_parser.add_argument('pin', help='The numeric positions of the PIN') |
182 | 186 | sendpin_parser.set_defaults(func=send_pin_handler) |
183 | 187 |
|
| 188 | + update_firmware_parser = subparsers.add_parser('updatefirmware', help='Verify and load firmware from a file onto a device') |
| 189 | + update_firmware_parser.add_argument('file', help='The path to the firmware file') |
| 190 | + update_firmware_parser.set_defaults(func=update_firmware_handler) |
| 191 | + |
184 | 192 | if sys.platform.startswith("linux"): |
185 | 193 | udevrules_parser = subparsers.add_parser('installudevrules', help='Install and load the udev rule files for the hardware wallet devices') |
186 | 194 | udevrules_parser.add_argument('--location', help='The path where the udev rules files will be copied', default='/etc/udev/rules.d/') |
|
0 commit comments