Google 智能家居应用测试操作失败

Actions on Google smart home app test fail

我正在为 google 家开发一个智能家居应用程序来控制智能设备。 我使用 gactions 来推送我的应用程序进行测试:

gactions test --action_package action.json --project <project-name>

直到今天一切正常,测试命令returns错误:

Pushing the app for the Assistant for testing...
ERROR: Failed to test the app for the Assistant
ERROR: Invalid JSON payload received. Unknown name "device_control" at 'preview_
action_package.action_package.actions[0]': Cannot find field.
Field Violations:
#  Field                                             Description
1  preview_action_package.action_package.actions[0]  Invalid JSON payload receiv
ed. Unknown name "device_control" at 'preview_action_package.action_package.acti
ons[0]': Cannot find field.
2017/05/26 09:39:10 Server did not return HTTP 200

这是我的 action.json,自创建以来未更改:

{
    "actions": [{
    "name": "actions.devices",
    "deviceControl": {
    },
    "fulfillment": {
      "conversationName": "automation"
    }
  }],
    "conversations": {
      "automation": {
        "name": "automation",
        "url": "<my web endpoint>"
      }
    }
}

我的action.json里没有device_control。 经过一番尝试,解析器似乎将 'C' 视为 '_c'。

这是 Google 端的问题吗?

Google 的 JSON 处理通常将驼峰式命名和 underscore_naming 视为等效。在这种情况下,deviceControldevice_control 引用相同的东西。

我可以找到 deviceControlAction in the action package does not include deviceControl as a valid field. The only reference 的当前(截至 2017 年 5 月 18 日)规范在有关操作包的描述性文档中,但它同样留空且未在此处描述.

您或许可以安全地删除此条目。

只需删除:

"deviceControl": { },

在您的操作包中,然后它将起作用。

我刚刚验证了这种方式有效。