我有一个格式化为这个的JSON:
{
"contextElements": [
{
"type": "environment",
"isPattern": "false",
"id": "labMax",
"attributes": [
{
"name": "users",
"type": "vector",
"value": [{"userId":"0001", "status":"0"},{"userId":"0002", "status":"0"}]
},
{
"name": "rooms",
"type": "vector",
"value": [{"room1": [ {"id":"room1"}, {"owner":"1"}]},{"id":"room2"}, {"owner":"2"}]
},
{
"name": "sensors",
"type": "vector",
"value": [
{"sensor1": [ {"id":"1"}, {"location":"room1"},{"value":"11"},{"status":"ok"}]},
{"sensor2": [ {"id":"2"}, {"location":"room1"},{"value":"22"},{"status":"update"}]}
]
}
]
}
],
"updateAction": "APPEND"
}
我还在属性"传感器"上订阅了 ONCHANGE 。当我更新它时,不更改向量内的任何值,它会导致通知。可能这是一种错误的行为,因为只有在值发生变化时才会通知订户。另一方面,如果我使用 strings 或 integer 作为属性值,它可以正常工作。