action.devices.traits.TransportControl question



正在尝试实现TransportControl特性的action.devices.commands.mediaClosedCaptioningOn命令。。我在设备的SYNC意图上发送的transportControlSupportedCommands数组中包含了"CAPTION_CONTROL",但当我实际要求助手打开设备上的字幕时,它会回复";该设备不能播放视频";而我的代码实际上从未从Assistant获得EXECUTE Intent。

我也成功地实现了mediaShuffle命令,但注意到当我发出它时,Assistant会用";音乐将在当前项目"之后混洗;当我的设备真正播放视频时。

有人知道我是如何告诉助手我的设备播放视频的吗?我似乎在TransportControl的文档中找不到它——它可能有不同的特征吗?

编辑2020年10月13日:

根据请求,我当前正在为此设备发送的完整SYNC响应:

{
"requestId": "11724082196092058876",
"payload": {
"agentUserId": "xxxxxx",
"devices": [
{
"id": "10.0.6.252",
"type": "action.devices.types.STREAMING_STICK",
"traits": [
"action.devices.traits.TransportControl",
"action.devices.traits.Volume",
"action.devices.traits.MediaState"
],
"name": {
"name": "Bedroom Stick"
},
"willReportState": true,
"roomHint": "bedroom",
"attributes": {
"transportControlSupportedCommands": [
"NEXT",
"PREVIOUS",
"PAUSE",
"STOP",
"RESUME",
"CAPTION_CONTROL",
"SEEK_TO_POSITION",
"SEEK_RELATIVE",
"SET_REPEAT",
"SHUFFLE"
],
"volumeMaxLevel": 100,
"volumeCanMuteAndUnmute": true,
"levelStepSize": 10,
"commandOnlyVolume": false,
"volumeDefaultPercentage": 100,
"supportActivityState": false,
"supportPlaybackState": true
}
}
]
}
}

产生这个问题的精确辅助查询包括";好的谷歌,打开卧室贴纸上的字幕"(回应:"那个设备不能播放视频。"(;好了,谷歌,在卧室棒上洗牌"(回应:"好吧,音乐将在这首曲目之后开始混洗。"(

您需要对发布的同步响应进行某些更改,这些更改可能会使您的设备正常工作。

  • 在同步响应中,我确实看到您正在使用STREAMING_STICK作为设备类型。如果你浏览文档,你会发现这个设备具有以下所需的特性:

    • action.devices.traits.AppSelector

    • action.devices.traits.MediaState

    • action.devices.traits.TransportControl

    • action.devices.traits.Volume

    您的同步响应缺少AppSelector特性。

  • 最好在同步响应的末尾添加deviceInfo属性。

有关如何使用流式处理棒的更多信息,请点击此处:

https://developers.google.com/assistant/smarthome/guides/streamingstick#response

最新更新