我正在尝试使该action.devices.traits.Modes
特征起作用。根据action.devices.SYNC
要求,我返回以下响应:
{
"payload":{
"devices":[
{
"id":"12345",
"type":"action.devices.types.SWITCH",
"traits":[
"action.devices.traits.OnOff",
"action.devices.traits.StartStop",
"action.devices.traits.Modes"
],
"name":{
"defaultNames":null,
"name":"David",
"nicknames":null
},
"willReportState":false,
"roomHint":"living room",
"attributes":{
"pausable":true,
"availableModes":[
{
"name":"speed",
"name_values":[
{
"name_synonym":[
"speed"
],
"lang":"en"
}
],
"settings":[
{
"setting_name":"slow",
"setting_values":[
{
"setting_synonym":[
"slow"
],
"lang":"en"
}
]
},
{
"setting_name":"normal",
"setting_values":[
{
"setting_synonym":[
"normal"
],
"lang":"en"
}
]
},
{
"setting_name":"fast",
"setting_values":[
{
"setting_synonym":[
"fast"
],
"lang":"en"
}
]
}
],
"ordered":true
}
]
}
}
]
}
}
我在https://developers.google.com/actions/smarthome/tools/validator/上验证了这个回复,并得到了很好的反馈。
现在,当我在智能手机上的控制台或助手中键入以下短语之一时,不会调用履行服务:
What mode is David in?
What speed is David in?
What is the David's speed?
Set the speed of David to normal.
Set David's speed to normal.
Set David to normal speed.
...
所有这些都简单地回退到谷歌搜索。
这些特征action.devices.traits.OnOff
,action.devices.traits.StartStop
但是工作正常。以下短语按预期工作:
Turn David on
Resume David.
...
我不知道出了什么问题以及我应该做些什么来调试它。AFAIK,智能家居服务或多或少是一个黑匣子,所以我不确定这里发生了什么/错误。