Install
openclaw skills install pugoing-smart提供 Pugoing 中控平台的常用 API 调用能力,用于查询区域、主机、设备,以及通过自然语言控制设备。
openclaw skills install pugoing-smart这个目录提供一个通用调用脚本,目标是让 Agent 用尽量少的上下文完成对 Pugoing 平台的常见调用。
环境变量示例:
export PUGOING_BASE_URL="http://127.0.0.1:8080"
export PUGOING_API_KEY="xq_agent_xxx"
export PUGOING_TIMEOUT="30"
说明:
PUGOING_API_KEY 必选,格式通常是 xq_agent_xxxPUGOING_BASE_URL 可选,默认是 http://127.0.0.1:8080, 一般是局域网地址PUGOING_TIMEOUT 可选,单位秒,默认 30脚本会自动处理读环境变量和鉴权. 调用方只需要专注于传入正确的JSON即可.
推荐传一个 JSON 对象给 client.py:
{
"path": "/api/xq_host/list",
"method": "GET"
}
字段说明:
path: 相对路径,推荐写法url: 也支持完整 URL;如果同时给了 url,优先使用 urlmethod: GET 或 POSTparams: 查询参数data: JSON bodyheaders: 额外请求头timeout: 单次请求超时秒数client.py 支持两种输入方式:
python client.py examples/list_hosts.json
echo '{"path":"/api/xq_host/list","method":"GET"}' | python client.py -
调用:
/api/host_area/list示例:
python client.py examples/list_areas_and_hosts.json
调用:
/api/xq_host/list示例:
python client.py examples/list_hosts.json
调用:
/api/device/sync?host_ip=...示例:
python client.py examples/list_host_devices.json
调用:
/api/device/control/voice推荐只传:
host_ipdvcm示例:
python client.py examples/control_device_by_dvcm.json
请求体示例:
{
"host_ip": "192.168.1.88",
"dvcm": "打开客厅灯"
}
调用:
/api/ai/chat建议:
host_ip 传 "global"host_ip 传实际主机 IP示例:
python client.py examples/ai_fallback.json