mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 18:16:21 +00:00
Refactor device name display in Action and Condition models
This commit is contained in:
@ -76,6 +76,8 @@ class Action {
|
||||
String? type;
|
||||
final String productType;
|
||||
|
||||
final String deviceName;
|
||||
|
||||
Action({
|
||||
required this.actionExecutor,
|
||||
required this.entityId,
|
||||
@ -83,6 +85,7 @@ class Action {
|
||||
this.name,
|
||||
this.type,
|
||||
required this.productType,
|
||||
required this.deviceName,
|
||||
});
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
@ -95,6 +98,7 @@ class Action {
|
||||
name: json['name'] as String?,
|
||||
type: json['type'] as String?,
|
||||
productType: json['productType'] as String,
|
||||
deviceName: json['deviceName'] as String,
|
||||
);
|
||||
}
|
||||
if (json["executorProperty"] == null) {
|
||||
@ -106,6 +110,7 @@ class Action {
|
||||
entityId: json["entityId"] as String,
|
||||
executorProperty: ExecutorProperty.fromJson(json["executorProperty"]),
|
||||
productType: json['productType'] as String,
|
||||
deviceName: json['deviceName'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
@ -147,6 +152,7 @@ class Condition {
|
||||
final String entityType;
|
||||
final Expr expr;
|
||||
final String productType;
|
||||
final String deviceName;
|
||||
|
||||
Condition({
|
||||
required this.code,
|
||||
@ -154,6 +160,7 @@ class Condition {
|
||||
required this.entityType,
|
||||
required this.expr,
|
||||
required this.productType,
|
||||
required this.deviceName,
|
||||
});
|
||||
|
||||
factory Condition.fromRawJson(String str) =>
|
||||
@ -167,6 +174,7 @@ class Condition {
|
||||
entityType: json["entityType"],
|
||||
expr: Expr.fromJson(json["expr"]),
|
||||
productType: json['productType'] as String,
|
||||
deviceName: json['deviceName'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
Reference in New Issue
Block a user