mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 18:16:21 +00:00
push automation function add conditions
This commit is contained in:
@ -73,6 +73,7 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
|
|||||||
|
|
||||||
void addToTempTaskList(
|
void addToTempTaskList(
|
||||||
TempHoldSceneTasksEvent event, Emitter<CreateSceneState> emit) {
|
TempHoldSceneTasksEvent event, Emitter<CreateSceneState> emit) {
|
||||||
|
emit(CreateSceneLoading());
|
||||||
bool updated = false;
|
bool updated = false;
|
||||||
for (var element in tempTasksList) {
|
for (var element in tempTasksList) {
|
||||||
if (element.code == event.deviceControlModel.code) {
|
if (element.code == event.deviceControlModel.code) {
|
||||||
@ -124,6 +125,7 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
|
|||||||
|
|
||||||
void addToTempAutomationTaskList(
|
void addToTempAutomationTaskList(
|
||||||
TempHoldSceneTasksEvent event, Emitter<CreateSceneState> emit) {
|
TempHoldSceneTasksEvent event, Emitter<CreateSceneState> emit) {
|
||||||
|
emit(CreateSceneLoading());
|
||||||
bool updated = false;
|
bool updated = false;
|
||||||
for (var element in automationTempTasksList) {
|
for (var element in automationTempTasksList) {
|
||||||
if (element.code == event.deviceControlModel.code) {
|
if (element.code == event.deviceControlModel.code) {
|
||||||
@ -177,6 +179,7 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
|
|||||||
|
|
||||||
FutureOr<void> _selectedValue(
|
FutureOr<void> _selectedValue(
|
||||||
SelectedValueEvent event, Emitter<CreateSceneState> emit) {
|
SelectedValueEvent event, Emitter<CreateSceneState> emit) {
|
||||||
|
emit(CreateSceneLoading());
|
||||||
if (event.isAutomation == true) {
|
if (event.isAutomation == true) {
|
||||||
automationSelectedValues[event.code] = event.value;
|
automationSelectedValues[event.code] = event.value;
|
||||||
emit(SelectedTaskValueState(value: event.value));
|
emit(SelectedTaskValueState(value: event.value));
|
||||||
@ -217,6 +220,7 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
|
|||||||
|
|
||||||
FutureOr<void> _removeTempTaskById(
|
FutureOr<void> _removeTempTaskById(
|
||||||
RemoveTempTaskByIdEvent event, Emitter<CreateSceneState> emit) {
|
RemoveTempTaskByIdEvent event, Emitter<CreateSceneState> emit) {
|
||||||
|
emit(CreateSceneLoading());
|
||||||
if (event.isAutomation == true) {
|
if (event.isAutomation == true) {
|
||||||
for (var element in automationTempTasksList) {
|
for (var element in automationTempTasksList) {
|
||||||
if (element.uniqueCustomId == event.code) {
|
if (element.uniqueCustomId == event.code) {
|
||||||
@ -264,6 +268,7 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
|
|||||||
|
|
||||||
FutureOr<void> _clearTaskList(
|
FutureOr<void> _clearTaskList(
|
||||||
ClearTaskListEvent event, Emitter<CreateSceneState> emit) {
|
ClearTaskListEvent event, Emitter<CreateSceneState> emit) {
|
||||||
|
emit(CreateSceneLoading());
|
||||||
automationTasksList.clear();
|
automationTasksList.clear();
|
||||||
tasksList.clear();
|
tasksList.clear();
|
||||||
emit(AddSceneTask(
|
emit(AddSceneTask(
|
||||||
@ -292,6 +297,7 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
|
|||||||
|
|
||||||
FutureOr<void> _clearTempTaskList(
|
FutureOr<void> _clearTempTaskList(
|
||||||
ClearTempTaskListEvent event, Emitter<CreateSceneState> emit) {
|
ClearTempTaskListEvent event, Emitter<CreateSceneState> emit) {
|
||||||
|
emit(CreateSceneLoading());
|
||||||
if (event.isAutomation == true) {
|
if (event.isAutomation == true) {
|
||||||
automationTempTasksList.clear();
|
automationTempTasksList.clear();
|
||||||
automationSelectedValues.clear();
|
automationSelectedValues.clear();
|
||||||
@ -307,6 +313,7 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
|
|||||||
|
|
||||||
FutureOr<void> _removeFromSelectedValueById(
|
FutureOr<void> _removeFromSelectedValueById(
|
||||||
RemoveFromSelectedValueById event, Emitter<CreateSceneState> emit) {
|
RemoveFromSelectedValueById event, Emitter<CreateSceneState> emit) {
|
||||||
|
emit(CreateSceneLoading());
|
||||||
if (event.isAutomation == true) {
|
if (event.isAutomation == true) {
|
||||||
if (automationSelectedValues.containsKey(event.code)) {
|
if (automationSelectedValues.containsKey(event.code)) {
|
||||||
automationSelectedValues.remove(event.code);
|
automationSelectedValues.remove(event.code);
|
||||||
@ -343,6 +350,7 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
|
|||||||
|
|
||||||
FutureOr<void> _updateTaskValue(
|
FutureOr<void> _updateTaskValue(
|
||||||
UpdateTaskEvent event, Emitter<CreateSceneState> emit) {
|
UpdateTaskEvent event, Emitter<CreateSceneState> emit) {
|
||||||
|
emit(CreateSceneLoading());
|
||||||
if (event.isAutomation == true) {
|
if (event.isAutomation == true) {
|
||||||
for (var i = 0; i < automationTasksList.length; i++) {
|
for (var i = 0; i < automationTasksList.length; i++) {
|
||||||
if (automationTasksList[i].uniqueCustomId == event.taskId) {
|
if (automationTasksList[i].uniqueCustomId == event.taskId) {
|
||||||
@ -352,8 +360,6 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
emit(AddSceneTask(
|
|
||||||
tasksList: tasksList, automationTasksList: automationTasksList));
|
|
||||||
} else {
|
} else {
|
||||||
for (var i = 0; i < tasksList.length; i++) {
|
for (var i = 0; i < tasksList.length; i++) {
|
||||||
if (tasksList[i].uniqueCustomId == event.taskId) {
|
if (tasksList[i].uniqueCustomId == event.taskId) {
|
||||||
@ -363,8 +369,8 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
emit(AddSceneTask(
|
|
||||||
tasksList: tasksList, automationTasksList: automationTasksList));
|
|
||||||
}
|
}
|
||||||
|
emit(AddSceneTask(
|
||||||
|
tasksList: tasksList, automationTasksList: automationTasksList));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -231,6 +231,105 @@ mixin SceneOperationsDataHelper {
|
|||||||
OperationDialogType.onOff,
|
OperationDialogType.onOff,
|
||||||
_createOnOffOptions(),
|
_createOnOffOptions(),
|
||||||
isAutomation);
|
isAutomation);
|
||||||
|
case 'unlock_fingerprint':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'WIFI LOCK PRO',
|
||||||
|
Assets.assetsFingerprintUnlock,
|
||||||
|
'Fingerprint Unlock',
|
||||||
|
OperationDialogType.integerSteps,
|
||||||
|
_createFingerprintUnlockOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'unlock_password':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'WIFI LOCK PRO',
|
||||||
|
Assets.assetsPasswordUnlock,
|
||||||
|
'Password Unlock',
|
||||||
|
OperationDialogType.integerSteps,
|
||||||
|
_createPasswordUnlockOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'unlock_card':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'WIFI LOCK PRO',
|
||||||
|
Assets.assetsCardUnlock,
|
||||||
|
'Card Unlock',
|
||||||
|
OperationDialogType.integerSteps,
|
||||||
|
_createCardUnlockOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'alarm_lock':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'WIFI LOCK PRO',
|
||||||
|
Assets.assetsLockAlarm,
|
||||||
|
'Lock Alarm',
|
||||||
|
OperationDialogType.listOfOptions,
|
||||||
|
_createLockAlarmOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'unlock_request':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'WIFI LOCK PRO',
|
||||||
|
Assets.assetsRemoteUnlockReq,
|
||||||
|
'Remote Unlock Request',
|
||||||
|
OperationDialogType.integerSteps,
|
||||||
|
_createUnlockRequestOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'residual_electricity':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'WIFI LOCK PRO',
|
||||||
|
Assets.assetsResidualElectricity,
|
||||||
|
'Residual Electricity',
|
||||||
|
OperationDialogType.integerSteps,
|
||||||
|
_createResidualElectricityOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'reverse_lock':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'WIFI LOCK PRO',
|
||||||
|
Assets.assetsDoubleLock,
|
||||||
|
'Double Lock',
|
||||||
|
OperationDialogType.onOff,
|
||||||
|
_createOnOffOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'unlock_app':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'WIFI LOCK PRO',
|
||||||
|
Assets.assetsRemoteUnlockViaApp,
|
||||||
|
'Remote Unlock Via App',
|
||||||
|
OperationDialogType.integerSteps,
|
||||||
|
_createUnlockAppOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'hijack':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'WIFI LOCK PRO',
|
||||||
|
Assets.assetsHijackAlarm,
|
||||||
|
'Hijack Alarm',
|
||||||
|
OperationDialogType.onOff,
|
||||||
|
_createOnOffOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'doorbell':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'WIFI LOCK PRO',
|
||||||
|
Assets.assetsDoorlockNormalOpen,
|
||||||
|
'Doorbell',
|
||||||
|
OperationDialogType.onOff,
|
||||||
|
_createOnOffOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'unlock_temporary':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'WIFI LOCK PRO',
|
||||||
|
Assets.assetsTempPasswordUnlock,
|
||||||
|
'Temporary Password Unlock',
|
||||||
|
OperationDialogType.integerSteps,
|
||||||
|
_createTemporaryPasswordUnlockOptions(),
|
||||||
|
isAutomation);
|
||||||
case 'far_detection':
|
case 'far_detection':
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
@ -276,86 +375,41 @@ mixin SceneOperationsDataHelper {
|
|||||||
OperationDialogType.countdown,
|
OperationDialogType.countdown,
|
||||||
_createCountdownOptions(),
|
_createCountdownOptions(),
|
||||||
isAutomation);
|
isAutomation);
|
||||||
case 'switch_alarm_sound':
|
case 'presence_state':
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Multi-Mode Gateway Z-W-B',
|
'Human Presence Sensor',
|
||||||
Assets.assetsSwitchAlarmSound,
|
Assets.assetsPresenceState,
|
||||||
'Switch Alarm Sound',
|
'Presence State',
|
||||||
OperationDialogType.onOff,
|
|
||||||
_createOnOffOptions(),
|
|
||||||
isAutomation);
|
|
||||||
case 'master_state':
|
|
||||||
return _createSceneFunction(
|
|
||||||
action,
|
|
||||||
'Multi-Mode Gateway Z-W-B',
|
|
||||||
Assets.assetsMasterState,
|
|
||||||
'Master State',
|
|
||||||
OperationDialogType.listOfOptions,
|
OperationDialogType.listOfOptions,
|
||||||
_createMasterStateOptions(),
|
_createPresenceStateOptions(),
|
||||||
isAutomation);
|
isAutomation);
|
||||||
case 'factory_reset':
|
case 'dis_current':
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Multi-Mode Gateway Z-W-B',
|
'Human Presence Sensor',
|
||||||
Assets.assetsFactoryReset,
|
Assets.assetsIconsPresenceSensorAssetsDistance,
|
||||||
'Reset Factory',
|
'Current Distance',
|
||||||
OperationDialogType.onOff,
|
OperationDialogType.integerSteps,
|
||||||
_createOnOffOptions(),
|
_createCurrentDistanceOptions(),
|
||||||
isAutomation);
|
isAutomation);
|
||||||
case 'switch_1':
|
case 'illuminance_value':
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'3 Gang Button Switch L-L',
|
'Human Presence Sensor',
|
||||||
Assets.assetsAcPower,
|
Assets.assetsIconsPresenceSensorAssetsIlluminanceValue,
|
||||||
'Light 1 Switch',
|
'Illuminance Value',
|
||||||
OperationDialogType.onOff,
|
OperationDialogType.integerSteps,
|
||||||
_createOnOffOptions(),
|
_createIlluminanceValueOptions(),
|
||||||
isAutomation);
|
isAutomation);
|
||||||
case 'switch_2':
|
case 'checking_result':
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'3 Gang Button Switch L-L',
|
'Human Presence Sensor',
|
||||||
Assets.assetsAcPower,
|
Assets.assetsSelfTestResult,
|
||||||
'Light 2 Switch',
|
'Self-Test Result',
|
||||||
OperationDialogType.onOff,
|
OperationDialogType.listOfOptions,
|
||||||
_createOnOffOptions(),
|
_createSelfTestResultOptions(),
|
||||||
isAutomation);
|
|
||||||
case 'switch_3':
|
|
||||||
return _createSceneFunction(
|
|
||||||
action,
|
|
||||||
'3 Gang Button Switch L-L',
|
|
||||||
Assets.assetsAcPower,
|
|
||||||
'Light 3 Switch',
|
|
||||||
OperationDialogType.onOff,
|
|
||||||
_createOnOffOptions(),
|
|
||||||
isAutomation);
|
|
||||||
case 'countdown_1':
|
|
||||||
return _createSceneFunction(
|
|
||||||
action,
|
|
||||||
'3 Gang Button Switch L-L',
|
|
||||||
Assets.assetsLightCountdown,
|
|
||||||
'Light 1 CountDown',
|
|
||||||
OperationDialogType.countdown,
|
|
||||||
_createCountdownOptions(),
|
|
||||||
isAutomation);
|
|
||||||
case 'countdown_2':
|
|
||||||
return _createSceneFunction(
|
|
||||||
action,
|
|
||||||
'3 Gang Button Switch L-L',
|
|
||||||
Assets.assetsLightCountdown,
|
|
||||||
'Light 2 CountDown',
|
|
||||||
OperationDialogType.countdown,
|
|
||||||
_createCountdownOptions(),
|
|
||||||
isAutomation);
|
|
||||||
case 'countdown_3':
|
|
||||||
return _createSceneFunction(
|
|
||||||
action,
|
|
||||||
'3 Gang Button Switch L-L',
|
|
||||||
Assets.assetsLightCountdown,
|
|
||||||
'Light 3 CountDown',
|
|
||||||
OperationDialogType.countdown,
|
|
||||||
_createCountdownOptions(),
|
|
||||||
isAutomation);
|
isAutomation);
|
||||||
case 'switch':
|
case 'switch':
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
@ -406,12 +460,258 @@ mixin SceneOperationsDataHelper {
|
|||||||
OperationDialogType.onOff,
|
OperationDialogType.onOff,
|
||||||
_createOnOffOptions(),
|
_createOnOffOptions(),
|
||||||
isAutomation);
|
isAutomation);
|
||||||
|
case 'switch_1':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'3 Gang Button Switch L-L',
|
||||||
|
Assets.assetsIconsLightSwitchOn,
|
||||||
|
'Light 1 Switch',
|
||||||
|
OperationDialogType.onOff,
|
||||||
|
_createOnOffOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'switch_2':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'3 Gang Button Switch L-L',
|
||||||
|
Assets.assetsIconsLightSwitchOn,
|
||||||
|
'Light 2 Switch',
|
||||||
|
OperationDialogType.onOff,
|
||||||
|
_createOnOffOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'switch_3':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'3 Gang Button Switch L-L',
|
||||||
|
Assets.assetsIconsLightSwitchOn,
|
||||||
|
'Light 3 Switch',
|
||||||
|
OperationDialogType.onOff,
|
||||||
|
_createOnOffOptions(),
|
||||||
|
isAutomation);
|
||||||
|
|
||||||
|
case 'countdown_1':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'3 Gang Button Switch L-L',
|
||||||
|
Assets.assetsLightCountdown,
|
||||||
|
'Light 1 CountDown',
|
||||||
|
isAutomation
|
||||||
|
? OperationDialogType.integerSteps
|
||||||
|
: OperationDialogType.countdown,
|
||||||
|
isAutomation
|
||||||
|
? _createAutomationCountDownOptions()
|
||||||
|
: _createCountdownOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'countdown_2':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'3 Gang Button Switch L-L',
|
||||||
|
Assets.assetsLightCountdown,
|
||||||
|
'Light 2 CountDown',
|
||||||
|
isAutomation
|
||||||
|
? OperationDialogType.integerSteps
|
||||||
|
: OperationDialogType.countdown,
|
||||||
|
isAutomation
|
||||||
|
? _createAutomationCountDownOptions()
|
||||||
|
: _createCountdownOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'countdown_3':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'3 Gang Button Switch L-L',
|
||||||
|
Assets.assetsLightCountdown,
|
||||||
|
'Light 3 CountDown',
|
||||||
|
isAutomation
|
||||||
|
? OperationDialogType.integerSteps
|
||||||
|
: OperationDialogType.countdown,
|
||||||
|
isAutomation
|
||||||
|
? _createAutomationCountDownOptions()
|
||||||
|
: _createCountdownOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'switch_alarm_sound':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'Gateway',
|
||||||
|
Assets.assetsSwitchAlarmSound,
|
||||||
|
'Switch Alarm Sound',
|
||||||
|
OperationDialogType.onOff,
|
||||||
|
_createOnOffOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'master_state':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'Gateway',
|
||||||
|
Assets.assetsMasterState,
|
||||||
|
'Master State',
|
||||||
|
OperationDialogType.listOfOptions,
|
||||||
|
_createMasterStateOptions(),
|
||||||
|
isAutomation);
|
||||||
|
case 'factory_reset':
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'Gateway',
|
||||||
|
Assets.assetsFactoryReset,
|
||||||
|
'Factory Reset',
|
||||||
|
OperationDialogType.onOff,
|
||||||
|
_createOnOffOptions(),
|
||||||
|
isAutomation);
|
||||||
default:
|
default:
|
||||||
throw ArgumentError(
|
throw ArgumentError(
|
||||||
'Unsupported function code: ${executorProperty.functionCode}');
|
'Unsupported function code: ${executorProperty.functionCode}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<SceneOperationalValue> _createFingerprintUnlockOptions() {
|
||||||
|
return [
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: '',
|
||||||
|
description: "",
|
||||||
|
value: 0.0,
|
||||||
|
minValue: 0.0,
|
||||||
|
maxValue: 999,
|
||||||
|
stepValue: 1.0,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SceneOperationalValue> _createPasswordUnlockOptions() {
|
||||||
|
return [
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: '',
|
||||||
|
description: "",
|
||||||
|
value: 0.0,
|
||||||
|
minValue: 0.0,
|
||||||
|
maxValue: 999,
|
||||||
|
stepValue: 1.0,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SceneOperationalValue> _createCardUnlockOptions() {
|
||||||
|
return [
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: '',
|
||||||
|
description: "",
|
||||||
|
value: 0.0,
|
||||||
|
minValue: 0.0,
|
||||||
|
maxValue: 999,
|
||||||
|
stepValue: 1.0,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SceneOperationalValue> _createLockAlarmOptions() {
|
||||||
|
return [
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: Assets.assetsFingerprintUnlock,
|
||||||
|
description: "Fingerprint Mismatch",
|
||||||
|
value: 0,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SceneOperationalValue> _createUnlockRequestOptions() {
|
||||||
|
return [
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: '',
|
||||||
|
description: "",
|
||||||
|
value: 0.0,
|
||||||
|
minValue: 0,
|
||||||
|
maxValue: 90,
|
||||||
|
stepValue: 1,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SceneOperationalValue> _createResidualElectricityOptions() {
|
||||||
|
return [
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: '',
|
||||||
|
description: "",
|
||||||
|
value: 0.0,
|
||||||
|
minValue: 0,
|
||||||
|
maxValue: 100,
|
||||||
|
stepValue: 1,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SceneOperationalValue> _createUnlockAppOptions() {
|
||||||
|
return [
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: '',
|
||||||
|
description: "",
|
||||||
|
value: 0.0,
|
||||||
|
minValue: 0,
|
||||||
|
maxValue: 999,
|
||||||
|
stepValue: 1,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SceneOperationalValue> _createTemporaryPasswordUnlockOptions() {
|
||||||
|
return [
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: '',
|
||||||
|
description: "",
|
||||||
|
value: 0.0,
|
||||||
|
minValue: 0,
|
||||||
|
maxValue: 999,
|
||||||
|
stepValue: 1,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SceneOperationalValue> _createPresenceStateOptions() {
|
||||||
|
return [
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: Assets.assetsIconsPresenceSensorAssetsEmpty,
|
||||||
|
value: 'none',
|
||||||
|
description: 'None',
|
||||||
|
),
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: Assets.assetsPresence,
|
||||||
|
value: 'presence',
|
||||||
|
description: 'Presence',
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SceneOperationalValue> _createCurrentDistanceOptions() {
|
||||||
|
return [
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: '',
|
||||||
|
value: 0.0,
|
||||||
|
description: "CM",
|
||||||
|
minValue: 1,
|
||||||
|
maxValue: 600,
|
||||||
|
stepValue: 1,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SceneOperationalValue> _createIlluminanceValueOptions() {
|
||||||
|
return [
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: '',
|
||||||
|
value: 0.0,
|
||||||
|
description: "Lux",
|
||||||
|
minValue: 0,
|
||||||
|
maxValue: 10000,
|
||||||
|
stepValue: 1,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SceneOperationalValue> _createSelfTestResultOptions() {
|
||||||
|
return [
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: Assets.assetsSelfTestResult,
|
||||||
|
value: 'check_success',
|
||||||
|
description: 'Self Testing Success',
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
List<SceneOperationalValue> _createAutomationTemperatureOptions() {
|
List<SceneOperationalValue> _createAutomationTemperatureOptions() {
|
||||||
return [
|
return [
|
||||||
SceneOperationalValue(
|
SceneOperationalValue(
|
||||||
@ -436,6 +736,19 @@ mixin SceneOperationsDataHelper {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_createAutomationCountDownOptions() {
|
||||||
|
return [
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: '',
|
||||||
|
description: "sec",
|
||||||
|
value: 0.0,
|
||||||
|
minValue: 0,
|
||||||
|
maxValue: 43200,
|
||||||
|
stepValue: 1,
|
||||||
|
)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createSceneFunction(
|
SceneStaticFunction _createSceneFunction(
|
||||||
Action action,
|
Action action,
|
||||||
String deviceName,
|
String deviceName,
|
||||||
@ -547,8 +860,11 @@ mixin SceneOperationsDataHelper {
|
|||||||
return [SceneOperationalValue(icon: '', value: 0)];
|
return [SceneOperationalValue(icon: '', value: 0)];
|
||||||
}
|
}
|
||||||
|
|
||||||
List<SceneStaticFunction> getOperationsForOneFunction(
|
List<SceneStaticFunction> getOperationsForOneFunction({
|
||||||
{required String deviceId, required SceneStaticFunction taskItem}) {
|
required String deviceId,
|
||||||
|
required SceneStaticFunction taskItem,
|
||||||
|
required bool isAutomation,
|
||||||
|
}) {
|
||||||
if (deviceId.contains('delay')) {
|
if (deviceId.contains('delay')) {
|
||||||
return [
|
return [
|
||||||
SceneStaticFunction(
|
SceneStaticFunction(
|
||||||
@ -575,7 +891,7 @@ mixin SceneOperationsDataHelper {
|
|||||||
functionCode: taskItem.code,
|
functionCode: taskItem.code,
|
||||||
functionValue: taskItem.functionValue),
|
functionValue: taskItem.functionValue),
|
||||||
actionExecutor: ''),
|
actionExecutor: ''),
|
||||||
false)
|
isAutomation)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,9 @@ class ThenAddedTasksContainer extends StatelessWidget
|
|||||||
|
|
||||||
/// get the task functions
|
/// get the task functions
|
||||||
functionOperation = List.from(getOperationsForOneFunction(
|
functionOperation = List.from(getOperationsForOneFunction(
|
||||||
taskItem: taskItem, deviceId: taskItem.deviceId));
|
taskItem: taskItem,
|
||||||
|
deviceId: taskItem.deviceId,
|
||||||
|
isAutomation: isAutomation ?? false));
|
||||||
|
|
||||||
/// show alert dialog based on type
|
/// show alert dialog based on type
|
||||||
context.customAlertDialog(
|
context.customAlertDialog(
|
||||||
|
Reference in New Issue
Block a user