googlehomeactionsync无法使用有效的json响应



我使用了谷歌的json验证器,它说我的json是有效的,但出于某种原因,谷歌家庭控制仍然给了我"无法更新设置,请检查您的连接";。如果我故意在服务器中抛出一个错误(比如无效变量(,谷歌主页日志实际上会显示后端故障,但当我使用正确的json时,不会报告任何错误。还有什么错误呢?

这是我的json结构:

{
"requestId": "xxxxxxxxxxx",
"payload": {
"agentUserId": "xxxxxxxx",
"devices": [{
"id": "xxxxxxxxx",
"type": "action.devices.types.AIRPURIFIER",
"traits": ["action.devices.traits.OnOff", "action.devices.traits.Toggles", "action.devices.traits.FanSpeed", "action.devices.traits.SensorState"],
"name": {
"defaultNames": ["air Purifier"],
"name": "Air Purifier",
"nicknames": ["Air Cleaner"]
},
"willReportState": true,
"attributes": {
"commandOnlyOnOff": false,
"availableFanSpeeds": {
"speeds": [{
"speed_name": "S1",
"speed_values": [{
"speed_synonym": ["low", "speed 1"],
"lang": "en"
}]
}, {
"speed_name": "S2",
"speed_values": [{
"speed_synonym": ["midlow", "speed 2"],
"lang": "en"
}]
}, {
"speed_name": "S3",
"speed_values": [{
"speed_synonym": ["mid", "speed 3"],
"lang": "en"
}]
}, {
"speed_name": "S4",
"speed_values": [{
"speed_synonym": ["midhigh", "speed 4"],
"lang": "en"
}]
}, {
"speed_name": "S5",
"speed_values": [{
"speed_synonym": ["high", "speed 5"],
"lang": "en"
}]
}],
"ordered": true
},
"reversible": false,
"availableToggles": [{
"name": "automatic",
"name_values": [{
"name_synonym": ["auto", "auto mode"],
"lang": "en"
}]
}],
"sensorStatesSupported": [{
"name": "AirQuality",
"descriptiveCapabilities": {
"availableStates": ["healthy", "moderate", "unhealthy"]
}
}]
},
"deviceInfo": {
"manufacturer": "Hyperian",
"model": "100",
"hwVersion": "1.0",
"swVersion": "1.0"
}
}]
}
}

无法找到调试此类问题的有效方法。如果他们的云日志记录真正记录传入的json,而不仅仅是错误。

我的错误与json结构无关。

相关内容

  • 没有找到相关文章

最新更新