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