mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 10:06:16 +00:00
Bug fixes
This commit is contained in:
@ -14,9 +14,8 @@ import 'package:syncrow_app/generated/assets.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||
|
||||
mixin SceneOperationsDataHelper {
|
||||
final Map<DeviceType,
|
||||
Function(List<FunctionModel>, String, String, dynamic, bool)>
|
||||
_functionMap = {
|
||||
final Map<DeviceType, Function(List<FunctionModel>, String, String, dynamic, bool)> _functionMap =
|
||||
{
|
||||
DeviceType.LightBulb: lightBulbFunctions,
|
||||
DeviceType.CeilingSensor: ceilingSensorFunctions,
|
||||
DeviceType.WallSensor: wallSensorFunctions,
|
||||
@ -46,22 +45,16 @@ mixin SceneOperationsDataHelper {
|
||||
required bool isAutomation,
|
||||
}) {
|
||||
final functionValue = null;
|
||||
return _functionMap[type]?.call(
|
||||
functions, deviceId, deviceName, functionValue, isAutomation) ??
|
||||
lightBulbFunctions(
|
||||
functions, deviceId, deviceName, functionValue, isAutomation);
|
||||
return _functionMap[type]?.call(functions, deviceId, deviceName, functionValue, isAutomation) ??
|
||||
lightBulbFunctions(functions, deviceId, deviceName, functionValue, isAutomation);
|
||||
}
|
||||
|
||||
String getTitle({DeviceType? type}) {
|
||||
return _titleMap[type] ?? '';
|
||||
}
|
||||
|
||||
static List<SceneStaticFunction> ceilingSensorFunctions(
|
||||
List<FunctionModel> functions,
|
||||
String deviceId,
|
||||
String deviceName,
|
||||
dynamic functionValue,
|
||||
bool isAutomation) {
|
||||
static List<SceneStaticFunction> ceilingSensorFunctions(List<FunctionModel> functions,
|
||||
String deviceId, String deviceName, dynamic functionValue, bool isAutomation) {
|
||||
if (isAutomation) {
|
||||
return PresenceSensorHelperFunctions.automationPresenceSensorFunctions(
|
||||
deviceId, deviceName, functionValue);
|
||||
@ -70,35 +63,22 @@ mixin SceneOperationsDataHelper {
|
||||
deviceId, deviceName, functionValue);
|
||||
}
|
||||
|
||||
static List<SceneStaticFunction> curtainFunctions(
|
||||
List<FunctionModel> functions,
|
||||
String deviceId,
|
||||
String deviceName,
|
||||
dynamic functionValue,
|
||||
bool isAutomation) {
|
||||
static List<SceneStaticFunction> curtainFunctions(List<FunctionModel> functions, String deviceId,
|
||||
String deviceName, dynamic functionValue, bool isAutomation) {
|
||||
return [];
|
||||
}
|
||||
|
||||
static List<SceneStaticFunction> doorLockFunctions(
|
||||
List<FunctionModel> functions,
|
||||
String deviceId,
|
||||
String deviceName,
|
||||
dynamic functionValue,
|
||||
bool isAutomation) {
|
||||
static List<SceneStaticFunction> doorLockFunctions(List<FunctionModel> functions, String deviceId,
|
||||
String deviceName, dynamic functionValue, bool isAutomation) {
|
||||
if (isAutomation) {
|
||||
return DoorLockHelperFunctions.doorLockAutomationFunctions(
|
||||
deviceId, deviceName, functionValue);
|
||||
}
|
||||
return DoorLockHelperFunctions.doorLockTapToRunFunctions(
|
||||
deviceId, deviceName, functionValue);
|
||||
return DoorLockHelperFunctions.doorLockTapToRunFunctions(deviceId, deviceName, functionValue);
|
||||
}
|
||||
|
||||
static List<SceneStaticFunction> wallSensorFunctions(
|
||||
List<FunctionModel> functions,
|
||||
String deviceId,
|
||||
String deviceName,
|
||||
dynamic functionValue,
|
||||
bool isAutomation) {
|
||||
static List<SceneStaticFunction> wallSensorFunctions(List<FunctionModel> functions,
|
||||
String deviceId, String deviceName, dynamic functionValue, bool isAutomation) {
|
||||
if (isAutomation) {
|
||||
return HumanPresenceHelperFunctions.automationHumanPresenceFunctions(
|
||||
deviceId, deviceName, functionValue);
|
||||
@ -107,51 +87,31 @@ mixin SceneOperationsDataHelper {
|
||||
deviceId, deviceName, functionValue);
|
||||
}
|
||||
|
||||
static List<SceneStaticFunction> lightBulbFunctions(
|
||||
List<FunctionModel> functions,
|
||||
String deviceId,
|
||||
String deviceName,
|
||||
dynamic functionValue,
|
||||
bool isAutomation) {
|
||||
static List<SceneStaticFunction> lightBulbFunctions(List<FunctionModel> functions,
|
||||
String deviceId, String deviceName, dynamic functionValue, bool isAutomation) {
|
||||
return [];
|
||||
}
|
||||
|
||||
static List<SceneStaticFunction> gatewayFunctions(
|
||||
List<FunctionModel> functions,
|
||||
String deviceId,
|
||||
String deviceName,
|
||||
dynamic functionValue,
|
||||
bool isAutomation) {
|
||||
return GatewayHelperFunctions.tabToRunGatewayFunctions(
|
||||
deviceId, deviceName, functionValue);
|
||||
static List<SceneStaticFunction> gatewayFunctions(List<FunctionModel> functions, String deviceId,
|
||||
String deviceName, dynamic functionValue, bool isAutomation) {
|
||||
return GatewayHelperFunctions.tabToRunGatewayFunctions(deviceId, deviceName, functionValue);
|
||||
}
|
||||
|
||||
static List<SceneStaticFunction> threeGangFunctions(
|
||||
List<FunctionModel> functions,
|
||||
String deviceId,
|
||||
String deviceName,
|
||||
dynamic functionValue,
|
||||
bool isAutomation) {
|
||||
static List<SceneStaticFunction> threeGangFunctions(List<FunctionModel> functions,
|
||||
String deviceId, String deviceName, dynamic functionValue, bool isAutomation) {
|
||||
if (isAutomation) {
|
||||
return ThreeGangHelperFunctions.threeGangAutomationFunctions(
|
||||
deviceId, deviceName, functionValue);
|
||||
}
|
||||
return ThreeGangHelperFunctions.threeGangHelperFunctions(
|
||||
deviceId, deviceName, functionValue);
|
||||
return ThreeGangHelperFunctions.threeGangHelperFunctions(deviceId, deviceName, functionValue);
|
||||
}
|
||||
|
||||
static List<SceneStaticFunction> acFunctions(
|
||||
List<FunctionModel> functions,
|
||||
String deviceId,
|
||||
String deviceName,
|
||||
dynamic functionValue,
|
||||
bool isAutomation) {
|
||||
static List<SceneStaticFunction> acFunctions(List<FunctionModel> functions, String deviceId,
|
||||
String deviceName, dynamic functionValue, bool isAutomation) {
|
||||
if (isAutomation) {
|
||||
return ACFunctionsHelper.automationAcFunctions(
|
||||
deviceId, deviceName, functionValue);
|
||||
return ACFunctionsHelper.automationAcFunctions(deviceId, deviceName, functionValue);
|
||||
}
|
||||
return ACFunctionsHelper.tabToRunAcFunctions(
|
||||
deviceId, deviceName, functionValue);
|
||||
return ACFunctionsHelper.tabToRunAcFunctions(deviceId, deviceName, functionValue);
|
||||
}
|
||||
|
||||
List<SceneStaticFunction> getTaskListFunctionsFromApi({
|
||||
@ -189,12 +149,8 @@ mixin SceneOperationsDataHelper {
|
||||
SceneStaticFunction(
|
||||
deviceId: action.entityId,
|
||||
deviceName: action.name.toString(),
|
||||
deviceIcon: action.type == 'automation'
|
||||
? Assets.player
|
||||
: Assets.handClickIcon,
|
||||
icon: action.type == 'automation'
|
||||
? Assets.player
|
||||
: Assets.handClickIcon,
|
||||
deviceIcon: action.type == 'automation' ? Assets.player : Assets.handClickIcon,
|
||||
icon: action.type == 'automation' ? Assets.player : Assets.handClickIcon,
|
||||
operationName: action.type.toString(),
|
||||
operationDialogType: OperationDialogType.onOff,
|
||||
functionValue: action.actionExecutor,
|
||||
@ -214,8 +170,7 @@ mixin SceneOperationsDataHelper {
|
||||
),
|
||||
);
|
||||
} else {
|
||||
functions
|
||||
.add(_mapExecutorPropertyToSceneFunction(action, isAutomation));
|
||||
functions.add(_mapExecutorPropertyToSceneFunction(action, isAutomation));
|
||||
}
|
||||
}
|
||||
|
||||
@ -251,9 +206,7 @@ mixin SceneOperationsDataHelper {
|
||||
}) {
|
||||
final executorProperty = action.executorProperty;
|
||||
|
||||
final Map<String,
|
||||
SceneStaticFunction Function(Action, bool, String?, String?)>
|
||||
functionMap = {
|
||||
final Map<String, SceneStaticFunction Function(Action, bool, String?, String?)> functionMap = {
|
||||
'sensitivity': _createSensitivityFunction,
|
||||
'normal_open_switch': _createNormalOpenSwitchFunction,
|
||||
'unlock_fingerprint': _createUnlockFingerprintFunction,
|
||||
@ -329,16 +282,14 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createSensitivityFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createSensitivityFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Presence Sensor',
|
||||
Assets.assetsIconsSensors,
|
||||
'Sensitivity',
|
||||
isAutomation
|
||||
? OperationDialogType.integerSteps
|
||||
: OperationDialogType.listOfOptions,
|
||||
isAutomation ? OperationDialogType.integerSteps : OperationDialogType.listOfOptions,
|
||||
isAutomation ? _createIntegerStepsOptions() : _createSensitivityOptions(),
|
||||
isAutomation,
|
||||
comparator,
|
||||
@ -346,8 +297,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createNormalOpenSwitchFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createNormalOpenSwitchFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
@ -400,8 +351,8 @@ mixin SceneOperationsDataHelper {
|
||||
];
|
||||
}
|
||||
|
||||
SceneStaticFunction _createUnlockFingerprintFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createUnlockFingerprintFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
@ -415,8 +366,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createUnlockPasswordFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createUnlockPasswordFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
@ -430,8 +381,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createUnlockCardFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createUnlockCardFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
@ -445,8 +396,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createAlarmLockFunction(Action action, bool isAutomation,
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createAlarmLockFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
@ -460,8 +411,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createUnlockRequestFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createUnlockRequestFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
@ -475,8 +426,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createResidualElectricityFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createResidualElectricityFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
@ -490,8 +441,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createReverseLockFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createReverseLockFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
@ -505,8 +456,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createUnlockAppFunction(Action action, bool isAutomation,
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createUnlockAppFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
@ -520,8 +471,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createHijackFunction(Action action, bool isAutomation,
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createHijackFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
@ -535,8 +486,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createDoorbellFunction(Action action, bool isAutomation,
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createDoorbellFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
@ -550,8 +501,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createUnlockTemporaryFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createUnlockTemporaryFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
@ -565,8 +516,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createFarDetectionFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createFarDetectionFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
@ -580,8 +531,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createMotionSensitivityFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createMotionSensitivityFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
@ -595,8 +546,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createMotionlessSensitivityFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createMotionlessSensitivityFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
@ -610,8 +561,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createIndicatorFunction(Action action, bool isAutomation,
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createIndicatorFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
@ -625,8 +576,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createPresenceTimeFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createPresenceTimeFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
@ -640,8 +591,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createPresenceStateFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createPresenceStateFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
@ -655,16 +606,14 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createDisCurrentFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createDisCurrentFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
Assets.assetsIconsSensors,
|
||||
'Current Distance',
|
||||
isAutomation
|
||||
? OperationDialogType.integerSteps
|
||||
: OperationDialogType.countdown,
|
||||
isAutomation ? OperationDialogType.integerSteps : OperationDialogType.countdown,
|
||||
_createCurrentDistanceOptions(),
|
||||
isAutomation,
|
||||
comparator,
|
||||
@ -672,8 +621,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createIlluminanceValueFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createIlluminanceValueFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
@ -687,8 +636,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createCheckingResultFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createCheckingResultFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
@ -702,8 +651,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createSwitchFunction(Action action, bool isAutomation,
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createSwitchFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
@ -717,27 +666,23 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createTempSetFunction(Action action, bool isAutomation,
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createTempSetFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
Assets.assetsIconsAC,
|
||||
'Set Temperature',
|
||||
isAutomation
|
||||
? OperationDialogType.integerSteps
|
||||
: OperationDialogType.temperature,
|
||||
isAutomation
|
||||
? _createAutomationTemperatureOptions()
|
||||
: _createTemperatureOptions(),
|
||||
isAutomation ? OperationDialogType.integerSteps : OperationDialogType.temperature,
|
||||
isAutomation ? _createAutomationTemperatureOptions() : _createTemperatureOptions(),
|
||||
isAutomation,
|
||||
comparator,
|
||||
uniqueCustomId,
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createTempCurrentFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createTempCurrentFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
@ -751,8 +696,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createModeFunction(Action action, bool isAutomation,
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createModeFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
@ -766,8 +711,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createLevelFunction(Action action, bool isAutomation,
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createLevelFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
@ -781,8 +726,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createChildLockFunction(Action action, bool isAutomation,
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createChildLockFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
@ -796,8 +741,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createSwitch1Function(Action action, bool isAutomation,
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createSwitch1Function(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
@ -811,8 +756,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createSwitch2Function(Action action, bool isAutomation,
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createSwitch2Function(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
@ -826,8 +771,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createSwitch3Function(Action action, bool isAutomation,
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createSwitch3Function(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
@ -841,65 +786,53 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createCountdown1Function(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createCountdown1Function(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
Assets.assetsIcons3GangSwitch,
|
||||
'Light 1 CountDown',
|
||||
isAutomation
|
||||
? OperationDialogType.integerSteps
|
||||
: OperationDialogType.countdown,
|
||||
isAutomation
|
||||
? _createAutomationCountDownOptions()
|
||||
: _createCountdownOptions(),
|
||||
isAutomation ? OperationDialogType.integerSteps : OperationDialogType.countdown,
|
||||
isAutomation ? _createAutomationCountDownOptions() : _createCountdownOptions(),
|
||||
isAutomation,
|
||||
comparator,
|
||||
uniqueCustomId,
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createCountdown2Function(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createCountdown2Function(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
Assets.assetsIcons3GangSwitch,
|
||||
'Light 2 CountDown',
|
||||
isAutomation
|
||||
? OperationDialogType.integerSteps
|
||||
: OperationDialogType.countdown,
|
||||
isAutomation
|
||||
? _createAutomationCountDownOptions()
|
||||
: _createCountdownOptions(),
|
||||
isAutomation ? OperationDialogType.integerSteps : OperationDialogType.countdown,
|
||||
isAutomation ? _createAutomationCountDownOptions() : _createCountdownOptions(),
|
||||
isAutomation,
|
||||
comparator,
|
||||
uniqueCustomId,
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createCountdown3Function(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createCountdown3Function(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
Assets.assetsIcons3GangSwitch,
|
||||
'Light 3 CountDown',
|
||||
isAutomation
|
||||
? OperationDialogType.integerSteps
|
||||
: OperationDialogType.countdown,
|
||||
isAutomation
|
||||
? _createAutomationCountDownOptions()
|
||||
: _createCountdownOptions(),
|
||||
isAutomation ? OperationDialogType.integerSteps : OperationDialogType.countdown,
|
||||
isAutomation ? _createAutomationCountDownOptions() : _createCountdownOptions(),
|
||||
isAutomation,
|
||||
comparator,
|
||||
uniqueCustomId,
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createSwitchAlarmSoundFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createSwitchAlarmSoundFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Gateway',
|
||||
@ -913,8 +846,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createMasterStateFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createMasterStateFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Gateway',
|
||||
@ -928,8 +861,8 @@ mixin SceneOperationsDataHelper {
|
||||
);
|
||||
}
|
||||
|
||||
SceneStaticFunction _createFactoryResetFunction(Action action,
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
SceneStaticFunction _createFactoryResetFunction(
|
||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Gateway',
|
||||
@ -987,7 +920,7 @@ mixin SceneOperationsDataHelper {
|
||||
SceneOperationalValue(
|
||||
icon: Assets.assetsFingerprintUnlock,
|
||||
description: "Fingerprint Mismatch",
|
||||
value: 'wrong_password',
|
||||
value: 'wrong_finger',
|
||||
),
|
||||
];
|
||||
}
|
||||
@ -1247,12 +1180,8 @@ mixin SceneOperationsDataHelper {
|
||||
uniqueCustomId: taskItem.uniqueCustomId,
|
||||
deviceId: taskItem.deviceId,
|
||||
deviceName: taskItem.deviceName.toString(),
|
||||
deviceIcon: taskItem.operationName == 'automation'
|
||||
? Assets.player
|
||||
: Assets.handClickIcon,
|
||||
icon: taskItem.operationName == 'automation'
|
||||
? Assets.player
|
||||
: Assets.handClickIcon,
|
||||
deviceIcon: taskItem.operationName == 'automation' ? Assets.player : Assets.handClickIcon,
|
||||
icon: taskItem.operationName == 'automation' ? Assets.player : Assets.handClickIcon,
|
||||
operationName: taskItem.operationName,
|
||||
operationDialogType: OperationDialogType.onOff,
|
||||
functionValue: taskItem.functionValue == 'rule_enable' ? true : false,
|
||||
|
Reference in New Issue
Block a user