mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 07:14:55 +00:00
Refactor operation dialog types and add counter steps
This commit is contained in:
@ -8,6 +8,7 @@ import 'package:syncrow_app/features/scene/model/create_automation_model.dart';
|
||||
import 'package:syncrow_app/features/scene/model/create_scene_model.dart';
|
||||
import 'package:syncrow_app/features/scene/model/scene_static_function.dart';
|
||||
import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_countdown.dart';
|
||||
import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_counter.dart';
|
||||
import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_functions_body.dart';
|
||||
import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_slider_steps.dart';
|
||||
import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_temperature_body.dart';
|
||||
@ -132,7 +133,7 @@ mixin SceneLogicHelper {
|
||||
'presence_delay' ||
|
||||
action.executorProperty!.functionCode == 'none_delay') {
|
||||
action.executorProperty!.functionValue =
|
||||
action.executorProperty!.functionValue * 10;
|
||||
(action.executorProperty!.functionValue * 10).round();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -193,12 +194,12 @@ mixin SceneLogicHelper {
|
||||
if (action.executorProperty!.functionCode == 'near_detection' ||
|
||||
action.executorProperty!.functionCode == 'far_detection') {
|
||||
action.executorProperty!.functionValue =
|
||||
action.executorProperty!.functionValue * 100;
|
||||
(action.executorProperty!.functionValue * 100).round();
|
||||
} else if (action.executorProperty!.functionCode ==
|
||||
'presence_delay' ||
|
||||
action.executorProperty!.functionCode == 'none_delay') {
|
||||
action.executorProperty!.functionValue =
|
||||
action.executorProperty!.functionValue * 10;
|
||||
(action.executorProperty!.functionValue * 10).round();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -234,6 +235,13 @@ mixin SceneLogicHelper {
|
||||
functionValue: functionValue ?? taskItem.functionValue,
|
||||
isAutomation: isAutomation,
|
||||
);
|
||||
} else if (taskItem.operationDialogType ==
|
||||
OperationDialogType.counterSteps) {
|
||||
return AlertDialogCounterSteps(
|
||||
taskItem: taskItem,
|
||||
functionValue: functionValue ?? taskItem.functionValue,
|
||||
isAutomation: isAutomation,
|
||||
);
|
||||
}
|
||||
|
||||
return AlertDialogFunctionsOperationsBody(
|
||||
|
||||
Reference in New Issue
Block a user