mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 05:54:54 +00:00
actionType automation
This commit is contained in:
@ -99,6 +99,9 @@ mixin SceneLogicHelper {
|
|||||||
}
|
}
|
||||||
if (task.code == CreateSceneEnum.smartSceneSelect.name) {
|
if (task.code == CreateSceneEnum.smartSceneSelect.name) {
|
||||||
return CreateSceneAction(
|
return CreateSceneAction(
|
||||||
|
actionType: task.operationName.toLowerCase() == 'automation'
|
||||||
|
? 'automation'
|
||||||
|
: 'scene',
|
||||||
entityId: actions[index].deviceId,
|
entityId: actions[index].deviceId,
|
||||||
actionExecutor: actions[index].functionValue,
|
actionExecutor: actions[index].functionValue,
|
||||||
executorProperty: null);
|
executorProperty: null);
|
||||||
@ -173,21 +176,24 @@ mixin SceneLogicHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget getTheCorrectDialogBody(SceneStaticFunction taskItem, dynamic functionValue,
|
Widget getTheCorrectDialogBody(
|
||||||
|
SceneStaticFunction taskItem, dynamic functionValue,
|
||||||
{required bool isAutomation}) {
|
{required bool isAutomation}) {
|
||||||
if (taskItem.operationDialogType == OperationDialogType.temperature) {
|
if (taskItem.operationDialogType == OperationDialogType.temperature) {
|
||||||
return AlertDialogTemperatureBody(
|
return AlertDialogTemperatureBody(
|
||||||
taskItem: taskItem,
|
taskItem: taskItem,
|
||||||
functionValue: functionValue ?? taskItem.functionValue,
|
functionValue: functionValue ?? taskItem.functionValue,
|
||||||
);
|
);
|
||||||
} else if ((taskItem.operationDialogType == OperationDialogType.countdown) ||
|
} else if ((taskItem.operationDialogType ==
|
||||||
|
OperationDialogType.countdown) ||
|
||||||
(taskItem.operationDialogType == OperationDialogType.delay)) {
|
(taskItem.operationDialogType == OperationDialogType.delay)) {
|
||||||
return AlertDialogCountdown(
|
return AlertDialogCountdown(
|
||||||
durationValue: taskItem.functionValue ?? 0,
|
durationValue: taskItem.functionValue ?? 0,
|
||||||
functionValue: functionValue ?? taskItem.functionValue,
|
functionValue: functionValue ?? taskItem.functionValue,
|
||||||
function: taskItem,
|
function: taskItem,
|
||||||
);
|
);
|
||||||
} else if (taskItem.operationDialogType == OperationDialogType.integerSteps) {
|
} else if (taskItem.operationDialogType ==
|
||||||
|
OperationDialogType.integerSteps) {
|
||||||
return AlertDialogSliderSteps(
|
return AlertDialogSliderSteps(
|
||||||
taskItem: taskItem,
|
taskItem: taskItem,
|
||||||
functionValue: functionValue ?? taskItem.functionValue,
|
functionValue: functionValue ?? taskItem.functionValue,
|
||||||
|
|||||||
@ -95,21 +95,25 @@ class CreateSceneModel {
|
|||||||
|
|
||||||
class CreateSceneAction {
|
class CreateSceneAction {
|
||||||
String entityId;
|
String entityId;
|
||||||
|
String? actionType;
|
||||||
String actionExecutor;
|
String actionExecutor;
|
||||||
CreateSceneExecutorProperty? executorProperty;
|
CreateSceneExecutorProperty? executorProperty;
|
||||||
|
|
||||||
CreateSceneAction({
|
CreateSceneAction({
|
||||||
|
this.actionType,
|
||||||
required this.entityId,
|
required this.entityId,
|
||||||
required this.actionExecutor,
|
required this.actionExecutor,
|
||||||
required this.executorProperty,
|
required this.executorProperty,
|
||||||
});
|
});
|
||||||
|
|
||||||
CreateSceneAction copyWith({
|
CreateSceneAction copyWith({
|
||||||
|
String? actionType,
|
||||||
String? entityId,
|
String? entityId,
|
||||||
String? actionExecutor,
|
String? actionExecutor,
|
||||||
CreateSceneExecutorProperty? executorProperty,
|
CreateSceneExecutorProperty? executorProperty,
|
||||||
}) {
|
}) {
|
||||||
return CreateSceneAction(
|
return CreateSceneAction(
|
||||||
|
actionType: actionType,
|
||||||
entityId: entityId ?? this.entityId,
|
entityId: entityId ?? this.entityId,
|
||||||
actionExecutor: actionExecutor ?? this.actionExecutor,
|
actionExecutor: actionExecutor ?? this.actionExecutor,
|
||||||
executorProperty: executorProperty ?? this.executorProperty,
|
executorProperty: executorProperty ?? this.executorProperty,
|
||||||
@ -125,6 +129,7 @@ class CreateSceneAction {
|
|||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
|
"actionType": actionType,
|
||||||
'entityId': entityId,
|
'entityId': entityId,
|
||||||
'actionExecutor': actionExecutor,
|
'actionExecutor': actionExecutor,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user