为Google动作开发粉丝特征时,查询粉丝状态始终会返回失败。这是我的步骤:
同步
{
"id": "d25dde36-76cb-44aa-a649-b1f61bb3bebb",
"type": "action.devices.types.FAN",
"traits": ["action.devices.traits.OnOff", "action.devices.traits.FanSpeed"],
"name": {
"name": "living room fan"
},
"willReportState": false,
"attributes": {
"availableFanSpeeds": {
"ordered": true,
"speeds": [{
"speed_name": "low",
"speed_values": [{
"lang": "en",
"speed_synonym": ["low"]
}]
}, {
"speed_name": "medium",
"speed_values": [{
"lang": "en",
"speed_synonym": ["medium"]
}]
}, {
"speed_name": "high",
"speed_values": [{
"lang": "en",
"speed_synonym": ["high"]
}]
}]
}
},
"deviceInfo": {
"manufacturer": "XYZ"
},
"customData": {
"serialID": "001D10010334",
"type": "resource"
}
}
查询
{"inputs":[{"intent":"action.devices.QUERY","payload":{"devices":[{"customData":{"serialID":"001D10010334","type":"resource"},"id":"d25dde36-76cb-44aa-a649-b1f61bb3bebb"}]}}],"requestId":"16727804366400067692"}
技能回应
{"requestId":"16727804366400067692","payload":{"devices":{"d25dde36-76cb-44aa-a649-b1f61bb3bebb":{"online":true,"currentFanSpeedSetting":"medium","on":true}}}}
Google家庭扬声器
抱歉,我现在无法联系到客厅的粉丝。请再试一遍。
尽管返回的消息与文档this兼容,但为什么讲话者没有返回“正确的”消息。
认为可以对Fan OnOff进行查询。
有什么想法吗?
谢谢。
答案 0 :(得分:1)
可逆性状是强制性的。如果属性不完整,则特征不处于活动状态。
如果“ reversible”特征设置为true,则此设备支持双向吹风扇,并且可以接受反向风扇方向的命令。