插件

启用插件

  • 函数名:[Robot]下的方法enable_plugin
  • 参数:
    1. name: [str] 插件名称
  • 返回:[CommandStdout] 命令执行结果

示例程序

stdout = lebai:enable_plugin("camera")
print(stdout)
JSON-RPC
// 请求:
{ "jsonrpc": "2.0", "method": "enable_plugin", "params": [{"name": ""}], "id": 1 }
// 响应:
{ "jsonrpc": "2.0", "result": {"done": true, "stdout": "", "stderr": "", "code": 0}, "id": 1 }

禁用插件

示例程序

stdout = lebai:disable_plugin("camera")
print(stdout)
JSON-RPC
// 请求:
{ "jsonrpc": "2.0", "method": "disable_plugin", "params": [{"name": ""}], "id": 1 }
// 响应:
{ "jsonrpc": "2.0", "result": {"done": true, "stdout": "", "stderr": "", "code": 0}, "id": 1 }

执行插件命令行程序

  • 函数名:[Robot]下的方法run_plugin_cmd
  • 参数:
    1. name: [str] 插件名称
    2. params: [list[str]] 命令行参数列表。可选,默认空
  • 返回:[CommandStdout] 命令执行结果,同 启用插件

示例程序

stdout = lebai:run_plugin_cmd("camera", {"--help"})
print(stdout)
JSON-RPC
// 请求:
{ "jsonrpc": "2.0", "method": "run_plugin_cmd", "params": [{"name": "", "params": [""]}], "id": 1 }
// 响应:
{ "jsonrpc": "2.0", "result": {"done": true, "stdout": "", "stderr": "", "code": 0}, "id": 1 }