简体   繁体   中英

Actions on Google smart home app test fail

I am developing a smart home app for google home to control smart devices. I use gactions to push my app for testing:

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

Everything works fine until today, the test command returns error:

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

here is my action.json, it's not changed since created:

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

There is no device_control in my action.json. After some try, it seems the parser treat 'C' as '_c'.

Is this an issue on Google's end?

Google's JSON handling often treats camelCaseNaming and underscore_naming as equivalent. In this case, deviceControl and device_control are referencing the same thing.

The current (as of 18 May 2017) specification for an Action in the action package does not include deviceControl as a valid field. The only reference I can find to deviceControl is in descriptive documentation about the action package, but it is similarly left blank and not described there.

You can probably safely remove this entry.

just remove that:

"deviceControl": { },

in your action package, then it will work.

I just verified this way works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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