繁体   English   中英

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

[英]Actions on Google smart home app test fail

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

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

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

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处理通常将camelCaseNaming和underscore_naming视为等效。 在这种情况下, deviceControldevice_control引用的是同一件事。

用于当前(如5月18日2017)规范操作在动作包不包括deviceControl为有效的字段。 我可以找到的关于deviceControl唯一参考是关于操作包的描述性文档,但类似地留为空白,此处未进行描述。

您可能可以安全地删除该条目。

只需删除:

“ deviceControl”:{},

在您的操作包中,那么它将起作用。

我只是验证了这种方式的工作原理。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM