Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

属性为数组类型的场景联动触发异常 #474

Closed
liunanhao opened this issue Feb 4, 2024 · 6 comments
Closed

属性为数组类型的场景联动触发异常 #474

liunanhao opened this issue Feb 4, 2024 · 6 comments
Assignees

Comments

@liunanhao
Copy link

描述

当属性为数组类型时,尝试在场景联动中设置触发条件为不包含或全部包含在时,场景联动判断异常。
1707036189838

物模型只有一个温度数组属性
{
  "properties": [
    {
      "id": "temps",
      "name": "分布式温度",
      "expands": {
        "source": "device",
        "type": [
          "report"
        ]
      },
      "valueType": {
        "elementType": {
          "type": "float",
          "scale": 2
        },
        "type": "array"
      }
    }
  ]
}

异常结果

设置条件为不包含(20,60)时,以下输入结果仍旧触发

{
	"deviceId": "1754018387737407488",
	"properties": {
		"temps": [23.2,33.4]
	}
}

触发结果如下
1707036512006

疑问

请问是代码出现了问题,还是本人物模型或者场景联动设置错误,抑或是数据上报的json结构有误,望解答,谢谢

@bestfeng1020
Copy link
Contributor

23.2,33.4确实不包含在20 60数字之中。应该触发结果

@liunanhao
Copy link
Author

23.2,33.4确实不包含在20 60数字之中。应该触发结果

不好意思,我没理解这个回答?是您已经确认了有问题需要修正?还是说我提的这个问题是我自己理解错了,没有需要修正代码的地方?

@bestfeng1020
Copy link
Contributor

你上报的数据,确实不在设置的数据中,所以代码逻辑没问题。没有需要修正的代码

@liunanhao
Copy link
Author

我理解的数字是23.2比20大,比60小,在区间[20,60]范围内,"20 < 23.2 < 60",

不知道您程序是按照那样的逻辑进行判断的呢

@bestfeng1020
Copy link
Contributor

他是数组,不是区间。不存在范围的概念

@bestfeng1020
Copy link
Contributor

这个界面我们后续版本会优化

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants