add(规则引擎-场景联动): 场景联动增加读取属性后回复触发场景联动的拓展 (#533)

需要结合前端一起拓展,前端的实现基于属性上报,把属性上报reportProperty修改为eadPropertyReply即可。
This commit is contained in:
PengyuDeng 2024-07-08 10:12:07 +08:00 committed by GitHub
parent a4b48c7ec5
commit ed6540fbca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -124,6 +124,7 @@ public class DeviceOperation {
//属性相关
if (operator == Operator.readProperty
|| operator == Operator.reportProperty
|| operator == Operator.readPropertyReply
|| operator == Operator.writeProperty) {
terms.addAll(
this.createTerm(
@ -252,6 +253,7 @@ public class DeviceOperation {
case online:
case offline:
case reportProperty:
case readPropertyReply:
return;
case reportEvent:
Assert.hasText(eventId, "error.scene_rule_trigger_device_operation_event_id_cannot_be_null");
@ -281,6 +283,8 @@ public class DeviceOperation {
reportProperty,
//读取属性
readProperty,
//读取属性回复
readPropertyReply,
//修改属性
writeProperty,
//调用功能

View File

@ -107,6 +107,7 @@ public class DeviceTrigger extends DeviceSelectorSpec implements SceneTriggerPro
case writeProperty:
selectColumns.add("this.success \"success\"");
case reportProperty:
case readPropertyReply:
selectColumns.add("this.properties \"properties\"");
break;
case reportEvent:
@ -185,6 +186,9 @@ public class DeviceTrigger extends DeviceSelectorSpec implements SceneTriggerPro
case reportProperty:
topic = "/device/" + productId + "/%s/message/property/report";
break;
case readPropertyReply:
topic = "/device/" + productId + "/%s/message/property/read/reply";
break;
case reportEvent:
topic = "/device/" + productId + "/%s/message/event/" + operation.getEventId();
break;
@ -429,6 +433,7 @@ public class DeviceTrigger extends DeviceSelectorSpec implements SceneTriggerPro
case offline:
case reportEvent:
case reportProperty:
case readPropertyReply:
return;
}