From f7b34003cc3dfca7ef66570b3b6bf026dcda9c60 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Thu, 7 Sep 2023 14:19:06 +0200 Subject: [PATCH] plugin: device_model_name defaults to plugin name if not overridden. --- electrum/plugins/hw_wallet/plugin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/electrum/plugins/hw_wallet/plugin.py b/electrum/plugins/hw_wallet/plugin.py index f4550c75a..95d0cadc8 100644 --- a/electrum/plugins/hw_wallet/plugin.py +++ b/electrum/plugins/hw_wallet/plugin.py @@ -193,15 +193,18 @@ class HardwareClientBase: def device_manager(self) -> 'DeviceMgr': return self.plugin.device_manager() + @abstractmethod def is_pairable(self) -> bool: raise NotImplementedError() + @abstractmethod def close(self): raise NotImplementedError() def timeout(self, cutoff) -> None: pass + @abstractmethod def is_initialized(self) -> bool: """True if initialized, False if wiped.""" raise NotImplementedError() @@ -253,8 +256,9 @@ class HardwareClientBase: def device_model_name(self) -> Optional[str]: """Return the name of the model of this device, which might be displayed in the UI. E.g. for Trezor, "Trezor One" or "Trezor T". + If this method is not defined for a plugin, the plugin name is used as default """ - return None + return self.plugin.name def manipulate_keystore_dict_during_wizard_setup(self, d: dict) -> None: """Called during wallet creation in the wizard, before the keystore