当第一个命令成功而第二个命令在相同的 EXECUTE 意图上失败时如何编写响应消息
How to write a response message when first command succeeded and second command failed on same EXECUTE intent
我无法理解如何写出如下情况的回复。
先决条件
- AC_UNIT 支持 TEMPERATURE_SETTING 特征。
- AC_UNIT的可用ThermostatMode是"off,on,heat,cool"
- AC_UNIT现在的模式很酷
当我执行 "Set the heat to {temperature}" 时,google 发送如下消息。
当 ThermostatSetMode 命令成功但 ThermostatTemperatureSetPoint 失败时如何写入响应?
我是否无法编写包含每个命令结果的响应?
{
"inputs": [
{
"intent": "action.devices.EXECUTE",
"payload": {
"commands": [
{
"devices": [
{
"id": "device id"
}
],
"execution": [
{
"command": "action.devices.commands.ThermostatSetMode",
"params": {
"thermostatMode": "heat"
}
},
{
"command": "action.devices.commands.ThermostatTemperatureSetpoint",
"params": {
"thermostatTemperatureSetpoint": 32 // this is out of range value.
}
}
]
}
]
}
}
],
"requestId": "requestId"
}
谢谢。
没有办法在每个命令的基础上指定响应,只能在设备级别。在这种情况下,您最好的选择是 return an error 在响应中使用 valueOutOfRange
来提醒用户。
我无法理解如何写出如下情况的回复。
先决条件
- AC_UNIT 支持 TEMPERATURE_SETTING 特征。
- AC_UNIT的可用ThermostatMode是"off,on,heat,cool"
- AC_UNIT现在的模式很酷
当我执行 "Set the heat to {temperature}" 时,google 发送如下消息。
当 ThermostatSetMode 命令成功但 ThermostatTemperatureSetPoint 失败时如何写入响应?
我是否无法编写包含每个命令结果的响应?
{
"inputs": [
{
"intent": "action.devices.EXECUTE",
"payload": {
"commands": [
{
"devices": [
{
"id": "device id"
}
],
"execution": [
{
"command": "action.devices.commands.ThermostatSetMode",
"params": {
"thermostatMode": "heat"
}
},
{
"command": "action.devices.commands.ThermostatTemperatureSetpoint",
"params": {
"thermostatTemperatureSetpoint": 32 // this is out of range value.
}
}
]
}
]
}
}
],
"requestId": "requestId"
}
谢谢。
没有办法在每个命令的基础上指定响应,只能在设备级别。在这种情况下,您最好的选择是 return an error 在响应中使用 valueOutOfRange
来提醒用户。