来自 Google 智能家居 SDK 的空请求

Empty request from Google Smart Home SDK

我正在创建 Web 服务器以将我的 DIY 智能家居设备连接到 Google 家庭应用程序。

授权和令牌请求后 Google 服务器发出 POST 请求以完成 URL,但由于某种原因请求为空。根据文档,它必须是 SYNC 请求,但它不包含任何值,甚至请求 ID。

请求后我的 phone 出现错误 "Couldn't update the setting. Check your Internet connection."。

为什么会发生这种情况,我该如何解决?

const app=smarthome({ debug: true, });

app.onSync( async (body) => {
    return {
        requestId: body.requestId,
        payload: {
            agentUserId: "agentUserId",
            devices                       // devices list
        }
    };
});

server.post("/request", app);

哦,我忘了包括 body-parser 因为我使用的是通用网络服务器而不是 actions-on-google API。哈哈

案件结案。