code: async def dump_devinfo(dev: Device, file):
      
      import attr
  
      methods = await dev.get_supported_methods()
      res = {
          "supported_methods": {k: v.asdict() for k, v in methods.items()},
          "settings": [attr.asdict(x) for x in await dev.get_settings()],
          "sysinfo": attr.asdict(await dev.get_system_info()),
          "interface_info": attr.asdict(await dev.get_interface_information()),
      }
      if file:
          click.echo("Saving to file: %s" % file.name)
          json.dump(res, file, sort_keys=True, indent=4)
      else:
          click.echo(json.dumps(res, sort_keys=True, indent=4))
docs: Dump developer information.
  
      Pass `file` to write the results directly into a file.