【发布时间】:2019-09-30 03:42:04
【问题描述】:
我正在实施智能家居操作,并且在 Test Suite 上运行测试时,在亮度特性测试期间收到以下错误消息:
Starting test...
Utterance (1/1): Ok Google. Set the Dimmer brightness to 75 percent . . . . . . . . . . . . . . . . . . . . FAIL
AssertionError: Expected state to include: {"brightness":{"xRange":[55,95]}}, actual state: {"on":true}: expected false to be true
所有onoff 请求都运行良好,测试套件也没有抱怨,只需按应有的方式说“PASS”即可。
但BrightnessAbsolute 请求已被我的后端应用程序成功接收并处理(我什至可以看到在 Test Suite 运行时更改了灯),返回 JSON 响应文档中描述的格式。
请求:
{
"inputs":{
"0":{
"context":{
"locale_country":"CA",
"locale_language":"en"
},
"intent":"action.devices.EXECUTE",
"payload":{
"commands":{
"0":{
"devices":{
"0":{
"id":"xxxxxxxx"
}
},
"execution":{
"0":{
"command":"action.devices.commands.BrightnessAbsolute",
"params":{
"brightness":75
}
}
}
}
}
}
}
},
"requestId":"12608597522424949295"
}
回复:
{
"requestId":"12608597522424949295",
"payload":{
"commands":{
"0":{
"ids":{
"0":"xxxxxxxx"
},
"status":"SUCCESS",
"states":{
"on":true,
"brightness":75,
"online":true
}
}
}
}
}
有没有人知道如何让这个测试通过 Test Suite?谢谢。
【问题讨论】:
-
您是否在操作中实施报告状态?
-
嗨尼克!我确实实现了报告状态,但我只在设备被其他应用程序而不是 Google 助理更改时才向 HomeGraph 发送报告,而不是在 Google 助理提出任何请求之后。那么,在这种情况下,我是否应该始终在
EXECUTE意图之后发送报告状态?
标签: node.js actions-on-google google-smart-home