mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-28 00:44:54 +00:00
finished sending the delay in correct way
This commit is contained in:
@ -15,7 +15,8 @@ import 'package:syncrow_app/utils/context_extension.dart';
|
||||
mixin SceneLogicHelper {
|
||||
bool isOnlyDelayOrDelayLast(List<SceneStaticFunction> tasks) {
|
||||
final lastTask = tasks.last;
|
||||
return tasks.every((task) => task.code == 'delay') || lastTask.code == 'delay';
|
||||
return tasks.every((task) => task.code == 'delay') ||
|
||||
lastTask.code == 'delay';
|
||||
}
|
||||
|
||||
void handleSaveButtonPress(
|
||||
@ -44,12 +45,12 @@ mixin SceneLogicHelper {
|
||||
tasks.length,
|
||||
(index) {
|
||||
final task = tasks[index];
|
||||
if (task.code == 'delay') {
|
||||
if (task.deviceId == 'delay') {
|
||||
return CreateSceneAction(
|
||||
entityId: tasks[index].deviceId,
|
||||
actionExecutor: 'delay',
|
||||
executorProperty: CreateSceneExecutorProperty(
|
||||
functionCode: task.code,
|
||||
functionCode: '',
|
||||
functionValue: task.operationalValues.first.value,
|
||||
delaySeconds: 0,
|
||||
),
|
||||
@ -121,7 +122,8 @@ mixin SceneLogicHelper {
|
||||
);
|
||||
} else {
|
||||
return AlertDialogCountdown(
|
||||
durationValue: listOfSceneStaticFunction[index].functionValue ?? taskItem.functionValue,
|
||||
durationValue: listOfSceneStaticFunction[index].functionValue ??
|
||||
taskItem.functionValue,
|
||||
functionValue: taskItem.functionValue,
|
||||
function: listOfSceneStaticFunction[index],
|
||||
);
|
||||
|
||||
@ -60,8 +60,8 @@ class _AlertDialogCountdownState extends State<AlertDialogCountdown> {
|
||||
setState(() {
|
||||
durationInSeconds = newDuration.inSeconds;
|
||||
});
|
||||
context.read<CreateSceneBloc>().add(SelectedValueEvent(
|
||||
value: newDuration.inSeconds, code: widget.function.code));
|
||||
context.read<CreateSceneBloc>().add(
|
||||
SelectedValueEvent(value: newDuration.inSeconds, code: 'delay'));
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
@ -111,11 +111,11 @@ class CustomBottomSheetWidget extends StatelessWidget {
|
||||
title: functions[0].operationName,
|
||||
onConfirm: () {
|
||||
final selectedValue =
|
||||
context.read<CreateSceneBloc>().selectedValues[functions[0].code];
|
||||
context.read<CreateSceneBloc>().selectedValues['delay'];
|
||||
context.read<CreateSceneBloc>().add(TempHoldSceneTasksEvent(
|
||||
deviceControlModel: DeviceControlModel(
|
||||
deviceId: 'delay',
|
||||
code: functions[0].code,
|
||||
deviceId: '',
|
||||
code: '',
|
||||
value: selectedValue,
|
||||
),
|
||||
deviceId: 'delay',
|
||||
|
||||
Reference in New Issue
Block a user