Пример #1
0
    def device_info(self) -> Dict[str, Any]:
        """
        Returns an object with device information, e.g. name, passphrase status, etc.
        """
        # pylint: disable=no-member
        request = hww.Request()
        device_info_request = bitbox02_system.DeviceInfoRequest()
        request.device_info.CopyFrom(device_info_request)
        response = self._msg_query(request, expected_response="device_info")
        result = {
            "name":
            response.device_info.name,
            "version":
            response.device_info.version,
            "initialized":
            response.device_info.initialized,
            "mnemonic_passphrase_enabled":
            response.device_info.mnemonic_passphrase_enabled,
            "monotonic_increments_remaining":
            response.device_info.monotonic_increments_remaining,
        }
        if self.version >= semver.VersionInfo(9, 6, 0):
            result["securechip_model"] = response.device_info.securechip_model

        return result
Пример #2
0
 def device_info(self) -> Dict[str, Any]:
     # pylint: disable=no-member
     request = hww.Request()
     device_info_request = bitbox02_system.DeviceInfoRequest()
     request.device_info.CopyFrom(device_info_request)
     response = self._msg_query(request, expected_response="device_info")
     return {
         "name": response.device_info.name,
         "version": response.device_info.version,
         "initialized": response.device_info.initialized,
         "mnemonic_passphrase_enabled": response.device_info.mnemonic_passphrase_enabled,
         "monotonic_increments_remaining": response.device_info.monotonic_increments_remaining,
     }