mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-14 17:25:47 +00:00
push add temp task flag
This commit is contained in:
@ -93,7 +93,7 @@ mixin SceneLogicHelper {
|
||||
OperationDialogType.countdown) ||
|
||||
(taskItem.operationDialogType == OperationDialogType.delay)) {
|
||||
return AlertDialogCountdown(
|
||||
durationValue: taskItem.functionValue,
|
||||
durationValue: taskItem.functionValue ?? 0,
|
||||
functionValue: functionValue ?? taskItem.functionValue,
|
||||
function: taskItem,
|
||||
);
|
||||
|
@ -230,26 +230,27 @@ class DeviceFunctionsView extends StatelessWidget
|
||||
|
||||
void _showAutomationDialog(
|
||||
BuildContext context, SceneStaticFunction function, DeviceModel device) {
|
||||
final functionValues =
|
||||
context.read<CreateSceneBloc>().selectedValues[function.code];
|
||||
final automationFunctionValues =
|
||||
context.read<CreateSceneBloc>().automationSelectedValues[function.code];
|
||||
|
||||
context.customAlertDialog(
|
||||
alertBody: getTheCorrectDialogBody(
|
||||
function,
|
||||
functionValues,
|
||||
automationFunctionValues,
|
||||
),
|
||||
title: function.operationName,
|
||||
onConfirm: () {
|
||||
final selectedValue =
|
||||
context.read<CreateSceneBloc>().selectedValues[function.code];
|
||||
if (selectedValue == null) {
|
||||
final automationFunctionValues = context
|
||||
.read<CreateSceneBloc>()
|
||||
.automationSelectedValues[function.code];
|
||||
if (automationFunctionValues == null) {
|
||||
return;
|
||||
}
|
||||
context.read<CreateSceneBloc>().add(TempHoldSceneTasksEvent(
|
||||
deviceControlModel: DeviceControlModel(
|
||||
deviceId: device.uuid,
|
||||
code: function.code,
|
||||
value: selectedValue,
|
||||
value: automationFunctionValues,
|
||||
),
|
||||
deviceId: device.uuid ?? '',
|
||||
operation: function.operationName,
|
||||
@ -257,19 +258,19 @@ class DeviceFunctionsView extends StatelessWidget
|
||||
deviceName: device.name ?? '',
|
||||
uniqueId: function.uniqueCustomId,
|
||||
operationType: function.operationDialogType,
|
||||
isAutomation: true,
|
||||
));
|
||||
Navigator.pop(context);
|
||||
},
|
||||
onDismiss: () {
|
||||
final tempTaskList = context.read<CreateSceneBloc>().tempTasksList;
|
||||
for (var element in tempTaskList) {
|
||||
final automationTempTaskList =
|
||||
context.read<CreateSceneBloc>().automationTempTasksList;
|
||||
for (var element in automationTempTaskList) {
|
||||
if (element.code == function.code) {
|
||||
context
|
||||
.read<CreateSceneBloc>()
|
||||
.add(RemoveTempTaskByIdEvent(code: function.code));
|
||||
context
|
||||
.read<CreateSceneBloc>()
|
||||
.add(RemoveFromSelectedValueById(code: function.code));
|
||||
context.read<CreateSceneBloc>().add(RemoveTempTaskByIdEvent(
|
||||
code: function.code, isAutomation: true));
|
||||
context.read<CreateSceneBloc>().add(RemoveFromSelectedValueById(
|
||||
code: function.code, isAutomation: true));
|
||||
}
|
||||
}
|
||||
Navigator.pop(context);
|
||||
|
Reference in New Issue
Block a user