Implement Flush Mounted Presence Sensor Routine Control and change the device type logic

This commit is contained in:
mohammad
2025-05-11 16:33:11 +03:00
parent 2651de71e4
commit adb42f95e8
26 changed files with 1071 additions and 180 deletions

View File

@ -94,6 +94,8 @@ class CreateSceneModel {
}
class CreateSceneAction {
final String? productType;
String entityId;
String? actionType;
String actionExecutor;
@ -104,15 +106,18 @@ class CreateSceneAction {
required this.entityId,
required this.actionExecutor,
required this.executorProperty,
required this.productType,
});
CreateSceneAction copyWith({
String? productType,
String? actionType,
String? entityId,
String? actionExecutor,
CreateSceneExecutorProperty? executorProperty,
}) {
return CreateSceneAction(
productType: productType,
actionType: actionType,
entityId: entityId ?? this.entityId,
actionExecutor: actionExecutor ?? this.actionExecutor,
@ -126,18 +131,21 @@ class CreateSceneAction {
'entityId': entityId,
'actionExecutor': actionExecutor,
'executorProperty': executorProperty?.toMap(actionExecutor),
// 'productType': productType,
};
} else {
return {
"actionType": actionType,
'entityId': entityId,
'actionExecutor': actionExecutor,
// 'productType': productType,
};
}
}
factory CreateSceneAction.fromMap(Map<String, dynamic> map) {
return CreateSceneAction(
productType: map['productType'] ?? '',
entityId: map['entityId'] ?? '',
actionExecutor: map['actionExecutor'] ?? '',
executorProperty: