mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-26 10:44:55 +00:00
Merge pull request #85 from SyncrowIOT/SP-1285-FE-Add-Device-to-Routine
Sp 1285 fe add device to routine
This commit is contained in:
@ -169,18 +169,19 @@ class DeviceManagerBloc extends Bloc<DeviceManagerEvent, DeviceManagerState> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_getOnlyImplementedDevices(List<DeviceModel> devices) {
|
List<DeviceModel> _getOnlyImplementedDevices(List<DeviceModel> devices) {
|
||||||
List<DeviceModel> implementedDevices = [];
|
const allowedDeviceTypes = {
|
||||||
for (int i = 0; i < devices.length; i++) {
|
DeviceType.AC,
|
||||||
if (devices[i].productType == DeviceType.AC ||
|
DeviceType.DoorLock,
|
||||||
devices[i].productType == DeviceType.DoorLock ||
|
DeviceType.Gateway,
|
||||||
devices[i].productType == DeviceType.Gateway ||
|
DeviceType.WallSensor,
|
||||||
devices[i].productType == DeviceType.WallSensor ||
|
DeviceType.CeilingSensor,
|
||||||
devices[i].productType == DeviceType.CeilingSensor ||
|
DeviceType.ThreeGang,
|
||||||
devices[i].productType == DeviceType.ThreeGang) {
|
DeviceType.OneGang,
|
||||||
implementedDevices.add(devices[i]);
|
};
|
||||||
}
|
|
||||||
}
|
return devices
|
||||||
return implementedDevices;
|
.where((device) => allowedDeviceTypes.contains(device.productType))
|
||||||
|
.toList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,78 @@
|
|||||||
|
import 'package:syncrow_app/features/scene/enum/operation_dialog_type.dart';
|
||||||
|
import 'package:syncrow_app/features/scene/model/scene_static_function.dart';
|
||||||
|
import 'package:syncrow_app/generated/assets.dart';
|
||||||
|
|
||||||
|
class OneGangHelperFunctions {
|
||||||
|
static List<SceneStaticFunction> oneGangHelperFunctions(
|
||||||
|
String deviceId, String deviceName, functionValue) {
|
||||||
|
return [
|
||||||
|
SceneStaticFunction(
|
||||||
|
deviceId: deviceId,
|
||||||
|
deviceName: deviceName,
|
||||||
|
icon: Assets.assetsAcPower,
|
||||||
|
operationName: 'Light Switch',
|
||||||
|
code: 'switch_1',
|
||||||
|
functionValue: functionValue,
|
||||||
|
operationDialogType: OperationDialogType.onOff,
|
||||||
|
operationalValues: [
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: Assets.assetsAcPower, description: "ON", value: true),
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SceneStaticFunction(
|
||||||
|
deviceId: deviceId,
|
||||||
|
deviceName: deviceName,
|
||||||
|
icon: Assets.assetsLightCountdown,
|
||||||
|
operationName: 'Light CountDown',
|
||||||
|
code: 'countdown_1',
|
||||||
|
functionValue: functionValue,
|
||||||
|
operationDialogType: OperationDialogType.countdown,
|
||||||
|
operationalValues: [
|
||||||
|
SceneOperationalValue(icon: '', value: 0),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
static List<SceneStaticFunction> oneGangAutomationFunctions(
|
||||||
|
String deviceId, String deviceName, functionValue) {
|
||||||
|
return [
|
||||||
|
SceneStaticFunction(
|
||||||
|
deviceId: deviceId,
|
||||||
|
deviceName: deviceName,
|
||||||
|
icon: Assets.assetsAcPower,
|
||||||
|
operationName: 'Light Switch',
|
||||||
|
code: 'switch_1',
|
||||||
|
functionValue: functionValue,
|
||||||
|
operationDialogType: OperationDialogType.onOff,
|
||||||
|
operationalValues: [
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: Assets.assetsAcPower, description: "ON", value: true),
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: Assets.assetsAcPowerOFF, description: "OFF", value: false),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SceneStaticFunction(
|
||||||
|
deviceId: deviceId,
|
||||||
|
deviceName: deviceName,
|
||||||
|
icon: Assets.assetsLightCountdown,
|
||||||
|
operationName: 'Light CountDown',
|
||||||
|
code: 'countdown_1',
|
||||||
|
functionValue: functionValue,
|
||||||
|
operationDialogType: OperationDialogType.integerSteps,
|
||||||
|
operationalValues: [
|
||||||
|
SceneOperationalValue(
|
||||||
|
icon: '',
|
||||||
|
description: "sec",
|
||||||
|
value: 0.0,
|
||||||
|
minValue: 0,
|
||||||
|
maxValue: 43200,
|
||||||
|
stepValue: 1,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,6 +6,7 @@ import 'package:syncrow_app/features/scene/helper/functions_per_device/ac_functi
|
|||||||
import 'package:syncrow_app/features/scene/helper/functions_per_device/door_lock_functions.dart';
|
import 'package:syncrow_app/features/scene/helper/functions_per_device/door_lock_functions.dart';
|
||||||
import 'package:syncrow_app/features/scene/helper/functions_per_device/gateway_functions.dart';
|
import 'package:syncrow_app/features/scene/helper/functions_per_device/gateway_functions.dart';
|
||||||
import 'package:syncrow_app/features/scene/helper/functions_per_device/human_presence_functions.dart';
|
import 'package:syncrow_app/features/scene/helper/functions_per_device/human_presence_functions.dart';
|
||||||
|
import 'package:syncrow_app/features/scene/helper/functions_per_device/one_gang_functions.dart';
|
||||||
import 'package:syncrow_app/features/scene/helper/functions_per_device/presence_sensor.dart';
|
import 'package:syncrow_app/features/scene/helper/functions_per_device/presence_sensor.dart';
|
||||||
import 'package:syncrow_app/features/scene/helper/functions_per_device/three_gang_functions.dart';
|
import 'package:syncrow_app/features/scene/helper/functions_per_device/three_gang_functions.dart';
|
||||||
import 'package:syncrow_app/features/scene/model/scene_details_model.dart';
|
import 'package:syncrow_app/features/scene/model/scene_details_model.dart';
|
||||||
@ -14,8 +15,9 @@ import 'package:syncrow_app/generated/assets.dart';
|
|||||||
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||||
|
|
||||||
mixin SceneOperationsDataHelper {
|
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.LightBulb: lightBulbFunctions,
|
||||||
DeviceType.CeilingSensor: ceilingSensorFunctions,
|
DeviceType.CeilingSensor: ceilingSensorFunctions,
|
||||||
DeviceType.WallSensor: wallSensorFunctions,
|
DeviceType.WallSensor: wallSensorFunctions,
|
||||||
@ -24,6 +26,7 @@ mixin SceneOperationsDataHelper {
|
|||||||
DeviceType.Curtain: curtainFunctions,
|
DeviceType.Curtain: curtainFunctions,
|
||||||
DeviceType.ThreeGang: threeGangFunctions,
|
DeviceType.ThreeGang: threeGangFunctions,
|
||||||
DeviceType.Gateway: gatewayFunctions,
|
DeviceType.Gateway: gatewayFunctions,
|
||||||
|
DeviceType.OneGang: oneGangFunctions,
|
||||||
};
|
};
|
||||||
|
|
||||||
final Map<DeviceType, String> _titleMap = {
|
final Map<DeviceType, String> _titleMap = {
|
||||||
@ -35,7 +38,24 @@ mixin SceneOperationsDataHelper {
|
|||||||
DeviceType.Curtain: 'Curtain Functions',
|
DeviceType.Curtain: 'Curtain Functions',
|
||||||
DeviceType.ThreeGang: '3G Light Switch Functions',
|
DeviceType.ThreeGang: '3G Light Switch Functions',
|
||||||
DeviceType.Gateway: 'Gateway Functions',
|
DeviceType.Gateway: 'Gateway Functions',
|
||||||
|
DeviceType.OneGang: '1G Light Switch Conditions',
|
||||||
};
|
};
|
||||||
|
static String _productTypeCache = '';
|
||||||
|
|
||||||
|
//one gang functions
|
||||||
|
static List<SceneStaticFunction> oneGangFunctions(
|
||||||
|
List<FunctionModel> functions,
|
||||||
|
String deviceId,
|
||||||
|
String deviceName,
|
||||||
|
dynamic functionValue,
|
||||||
|
bool isAutomation) {
|
||||||
|
if (isAutomation) {
|
||||||
|
return OneGangHelperFunctions.oneGangAutomationFunctions(
|
||||||
|
deviceId, deviceName, functionValue);
|
||||||
|
}
|
||||||
|
return OneGangHelperFunctions.oneGangHelperFunctions(
|
||||||
|
deviceId, deviceName, functionValue);
|
||||||
|
}
|
||||||
|
|
||||||
List<SceneStaticFunction> getFunctionsWithIcons({
|
List<SceneStaticFunction> getFunctionsWithIcons({
|
||||||
DeviceType? type,
|
DeviceType? type,
|
||||||
@ -45,16 +65,22 @@ mixin SceneOperationsDataHelper {
|
|||||||
required bool isAutomation,
|
required bool isAutomation,
|
||||||
}) {
|
}) {
|
||||||
final functionValue = null;
|
final functionValue = null;
|
||||||
return _functionMap[type]?.call(functions, deviceId, deviceName, functionValue, isAutomation) ??
|
return _functionMap[type]?.call(
|
||||||
lightBulbFunctions(functions, deviceId, deviceName, functionValue, isAutomation);
|
functions, deviceId, deviceName, functionValue, isAutomation) ??
|
||||||
|
lightBulbFunctions(
|
||||||
|
functions, deviceId, deviceName, functionValue, isAutomation);
|
||||||
}
|
}
|
||||||
|
|
||||||
String getTitle({DeviceType? type}) {
|
String getTitle({DeviceType? type}) {
|
||||||
return _titleMap[type] ?? '';
|
return _titleMap[type] ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<SceneStaticFunction> ceilingSensorFunctions(List<FunctionModel> functions,
|
static List<SceneStaticFunction> ceilingSensorFunctions(
|
||||||
String deviceId, String deviceName, dynamic functionValue, bool isAutomation) {
|
List<FunctionModel> functions,
|
||||||
|
String deviceId,
|
||||||
|
String deviceName,
|
||||||
|
dynamic functionValue,
|
||||||
|
bool isAutomation) {
|
||||||
if (isAutomation) {
|
if (isAutomation) {
|
||||||
return PresenceSensorHelperFunctions.automationPresenceSensorFunctions(
|
return PresenceSensorHelperFunctions.automationPresenceSensorFunctions(
|
||||||
deviceId, deviceName, functionValue);
|
deviceId, deviceName, functionValue);
|
||||||
@ -63,22 +89,35 @@ mixin SceneOperationsDataHelper {
|
|||||||
deviceId, deviceName, functionValue);
|
deviceId, deviceName, functionValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<SceneStaticFunction> curtainFunctions(List<FunctionModel> functions, String deviceId,
|
static List<SceneStaticFunction> curtainFunctions(
|
||||||
String deviceName, dynamic functionValue, bool isAutomation) {
|
List<FunctionModel> functions,
|
||||||
|
String deviceId,
|
||||||
|
String deviceName,
|
||||||
|
dynamic functionValue,
|
||||||
|
bool isAutomation) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<SceneStaticFunction> doorLockFunctions(List<FunctionModel> functions, String deviceId,
|
static List<SceneStaticFunction> doorLockFunctions(
|
||||||
String deviceName, dynamic functionValue, bool isAutomation) {
|
List<FunctionModel> functions,
|
||||||
|
String deviceId,
|
||||||
|
String deviceName,
|
||||||
|
dynamic functionValue,
|
||||||
|
bool isAutomation) {
|
||||||
if (isAutomation) {
|
if (isAutomation) {
|
||||||
return DoorLockHelperFunctions.doorLockAutomationFunctions(
|
return DoorLockHelperFunctions.doorLockAutomationFunctions(
|
||||||
deviceId, deviceName, functionValue);
|
deviceId, deviceName, functionValue);
|
||||||
}
|
}
|
||||||
return DoorLockHelperFunctions.doorLockTapToRunFunctions(deviceId, deviceName, functionValue);
|
return DoorLockHelperFunctions.doorLockTapToRunFunctions(
|
||||||
|
deviceId, deviceName, functionValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<SceneStaticFunction> wallSensorFunctions(List<FunctionModel> functions,
|
static List<SceneStaticFunction> wallSensorFunctions(
|
||||||
String deviceId, String deviceName, dynamic functionValue, bool isAutomation) {
|
List<FunctionModel> functions,
|
||||||
|
String deviceId,
|
||||||
|
String deviceName,
|
||||||
|
dynamic functionValue,
|
||||||
|
bool isAutomation) {
|
||||||
if (isAutomation) {
|
if (isAutomation) {
|
||||||
return HumanPresenceHelperFunctions.automationHumanPresenceFunctions(
|
return HumanPresenceHelperFunctions.automationHumanPresenceFunctions(
|
||||||
deviceId, deviceName, functionValue);
|
deviceId, deviceName, functionValue);
|
||||||
@ -87,31 +126,51 @@ mixin SceneOperationsDataHelper {
|
|||||||
deviceId, deviceName, functionValue);
|
deviceId, deviceName, functionValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<SceneStaticFunction> lightBulbFunctions(List<FunctionModel> functions,
|
static List<SceneStaticFunction> lightBulbFunctions(
|
||||||
String deviceId, String deviceName, dynamic functionValue, bool isAutomation) {
|
List<FunctionModel> functions,
|
||||||
|
String deviceId,
|
||||||
|
String deviceName,
|
||||||
|
dynamic functionValue,
|
||||||
|
bool isAutomation) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<SceneStaticFunction> gatewayFunctions(List<FunctionModel> functions, String deviceId,
|
static List<SceneStaticFunction> gatewayFunctions(
|
||||||
String deviceName, dynamic functionValue, bool isAutomation) {
|
List<FunctionModel> functions,
|
||||||
return GatewayHelperFunctions.tabToRunGatewayFunctions(deviceId, deviceName, functionValue);
|
String deviceId,
|
||||||
|
String deviceName,
|
||||||
|
dynamic functionValue,
|
||||||
|
bool isAutomation) {
|
||||||
|
return GatewayHelperFunctions.tabToRunGatewayFunctions(
|
||||||
|
deviceId, deviceName, functionValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<SceneStaticFunction> threeGangFunctions(List<FunctionModel> functions,
|
static List<SceneStaticFunction> threeGangFunctions(
|
||||||
String deviceId, String deviceName, dynamic functionValue, bool isAutomation) {
|
List<FunctionModel> functions,
|
||||||
|
String deviceId,
|
||||||
|
String deviceName,
|
||||||
|
dynamic functionValue,
|
||||||
|
bool isAutomation) {
|
||||||
if (isAutomation) {
|
if (isAutomation) {
|
||||||
return ThreeGangHelperFunctions.threeGangAutomationFunctions(
|
return ThreeGangHelperFunctions.threeGangAutomationFunctions(
|
||||||
deviceId, deviceName, functionValue);
|
deviceId, deviceName, functionValue);
|
||||||
}
|
}
|
||||||
return ThreeGangHelperFunctions.threeGangHelperFunctions(deviceId, deviceName, functionValue);
|
return ThreeGangHelperFunctions.threeGangHelperFunctions(
|
||||||
|
deviceId, deviceName, functionValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<SceneStaticFunction> acFunctions(List<FunctionModel> functions, String deviceId,
|
static List<SceneStaticFunction> acFunctions(
|
||||||
String deviceName, dynamic functionValue, bool isAutomation) {
|
List<FunctionModel> functions,
|
||||||
|
String deviceId,
|
||||||
|
String deviceName,
|
||||||
|
dynamic functionValue,
|
||||||
|
bool isAutomation) {
|
||||||
if (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({
|
List<SceneStaticFunction> getTaskListFunctionsFromApi({
|
||||||
@ -149,8 +208,12 @@ mixin SceneOperationsDataHelper {
|
|||||||
SceneStaticFunction(
|
SceneStaticFunction(
|
||||||
deviceId: action.entityId,
|
deviceId: action.entityId,
|
||||||
deviceName: action.name.toString(),
|
deviceName: action.name.toString(),
|
||||||
deviceIcon: action.type == 'automation' ? Assets.player : Assets.handClickIcon,
|
deviceIcon: action.type == 'automation'
|
||||||
icon: action.type == 'automation' ? Assets.player : Assets.handClickIcon,
|
? Assets.player
|
||||||
|
: Assets.handClickIcon,
|
||||||
|
icon: action.type == 'automation'
|
||||||
|
? Assets.player
|
||||||
|
: Assets.handClickIcon,
|
||||||
operationName: action.type.toString(),
|
operationName: action.type.toString(),
|
||||||
operationDialogType: OperationDialogType.onOff,
|
operationDialogType: OperationDialogType.onOff,
|
||||||
functionValue: action.actionExecutor,
|
functionValue: action.actionExecutor,
|
||||||
@ -170,7 +233,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
functions.add(_mapExecutorPropertyToSceneFunction(action, isAutomation));
|
functions
|
||||||
|
.add(_mapExecutorPropertyToSceneFunction(action, isAutomation));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,7 +270,9 @@ mixin SceneOperationsDataHelper {
|
|||||||
}) {
|
}) {
|
||||||
final executorProperty = action.executorProperty;
|
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,
|
'sensitivity': _createSensitivityFunction,
|
||||||
'normal_open_switch': _createNormalOpenSwitchFunction,
|
'normal_open_switch': _createNormalOpenSwitchFunction,
|
||||||
'unlock_fingerprint': _createUnlockFingerprintFunction,
|
'unlock_fingerprint': _createUnlockFingerprintFunction,
|
||||||
@ -282,14 +348,16 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createSensitivityFunction(
|
SceneStaticFunction _createSensitivityFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Presence Sensor',
|
'Presence Sensor',
|
||||||
Assets.assetsIconsSensors,
|
Assets.assetsIconsSensors,
|
||||||
'Sensitivity',
|
'Sensitivity',
|
||||||
isAutomation ? OperationDialogType.integerSteps : OperationDialogType.listOfOptions,
|
isAutomation
|
||||||
|
? OperationDialogType.integerSteps
|
||||||
|
: OperationDialogType.listOfOptions,
|
||||||
isAutomation ? _createIntegerStepsOptions() : _createSensitivityOptions(),
|
isAutomation ? _createIntegerStepsOptions() : _createSensitivityOptions(),
|
||||||
isAutomation,
|
isAutomation,
|
||||||
comparator,
|
comparator,
|
||||||
@ -297,8 +365,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createNormalOpenSwitchFunction(
|
SceneStaticFunction _createNormalOpenSwitchFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'WIFI LOCK PRO',
|
'WIFI LOCK PRO',
|
||||||
@ -351,8 +419,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createUnlockFingerprintFunction(
|
SceneStaticFunction _createUnlockFingerprintFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'WIFI LOCK PRO',
|
'WIFI LOCK PRO',
|
||||||
@ -366,8 +434,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createUnlockPasswordFunction(
|
SceneStaticFunction _createUnlockPasswordFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'WIFI LOCK PRO',
|
'WIFI LOCK PRO',
|
||||||
@ -381,8 +449,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createUnlockCardFunction(
|
SceneStaticFunction _createUnlockCardFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'WIFI LOCK PRO',
|
'WIFI LOCK PRO',
|
||||||
@ -396,8 +464,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createAlarmLockFunction(
|
SceneStaticFunction _createAlarmLockFunction(Action action, bool isAutomation,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'WIFI LOCK PRO',
|
'WIFI LOCK PRO',
|
||||||
@ -411,8 +479,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createUnlockRequestFunction(
|
SceneStaticFunction _createUnlockRequestFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'WIFI LOCK PRO',
|
'WIFI LOCK PRO',
|
||||||
@ -426,8 +494,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createResidualElectricityFunction(
|
SceneStaticFunction _createResidualElectricityFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'WIFI LOCK PRO',
|
'WIFI LOCK PRO',
|
||||||
@ -441,8 +509,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createReverseLockFunction(
|
SceneStaticFunction _createReverseLockFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'WIFI LOCK PRO',
|
'WIFI LOCK PRO',
|
||||||
@ -456,8 +524,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createUnlockAppFunction(
|
SceneStaticFunction _createUnlockAppFunction(Action action, bool isAutomation,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'WIFI LOCK PRO',
|
'WIFI LOCK PRO',
|
||||||
@ -471,8 +539,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createHijackFunction(
|
SceneStaticFunction _createHijackFunction(Action action, bool isAutomation,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'WIFI LOCK PRO',
|
'WIFI LOCK PRO',
|
||||||
@ -486,8 +554,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createDoorbellFunction(
|
SceneStaticFunction _createDoorbellFunction(Action action, bool isAutomation,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'WIFI LOCK PRO',
|
'WIFI LOCK PRO',
|
||||||
@ -501,8 +569,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createUnlockTemporaryFunction(
|
SceneStaticFunction _createUnlockTemporaryFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'WIFI LOCK PRO',
|
'WIFI LOCK PRO',
|
||||||
@ -516,8 +584,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createFarDetectionFunction(
|
SceneStaticFunction _createFarDetectionFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Human Presence Sensor',
|
'Human Presence Sensor',
|
||||||
@ -531,8 +599,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createMotionSensitivityFunction(
|
SceneStaticFunction _createMotionSensitivityFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Human Presence Sensor',
|
'Human Presence Sensor',
|
||||||
@ -546,8 +614,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createMotionlessSensitivityFunction(
|
SceneStaticFunction _createMotionlessSensitivityFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Human Presence Sensor',
|
'Human Presence Sensor',
|
||||||
@ -561,8 +629,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createIndicatorFunction(
|
SceneStaticFunction _createIndicatorFunction(Action action, bool isAutomation,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Human Presence Sensor',
|
'Human Presence Sensor',
|
||||||
@ -576,8 +644,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createPresenceTimeFunction(
|
SceneStaticFunction _createPresenceTimeFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Human Presence Sensor',
|
'Human Presence Sensor',
|
||||||
@ -591,8 +659,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createPresenceStateFunction(
|
SceneStaticFunction _createPresenceStateFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Human Presence Sensor',
|
'Human Presence Sensor',
|
||||||
@ -606,14 +674,16 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createDisCurrentFunction(
|
SceneStaticFunction _createDisCurrentFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Human Presence Sensor',
|
'Human Presence Sensor',
|
||||||
Assets.assetsIconsSensors,
|
Assets.assetsIconsSensors,
|
||||||
'Current Distance',
|
'Current Distance',
|
||||||
isAutomation ? OperationDialogType.integerSteps : OperationDialogType.countdown,
|
isAutomation
|
||||||
|
? OperationDialogType.integerSteps
|
||||||
|
: OperationDialogType.countdown,
|
||||||
_createCurrentDistanceOptions(),
|
_createCurrentDistanceOptions(),
|
||||||
isAutomation,
|
isAutomation,
|
||||||
comparator,
|
comparator,
|
||||||
@ -621,8 +691,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createIlluminanceValueFunction(
|
SceneStaticFunction _createIlluminanceValueFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Human Presence Sensor',
|
'Human Presence Sensor',
|
||||||
@ -636,8 +706,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createCheckingResultFunction(
|
SceneStaticFunction _createCheckingResultFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Human Presence Sensor',
|
'Human Presence Sensor',
|
||||||
@ -651,8 +721,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createSwitchFunction(
|
SceneStaticFunction _createSwitchFunction(Action action, bool isAutomation,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Smart AC Thermostat - Grey - Model A',
|
'Smart AC Thermostat - Grey - Model A',
|
||||||
@ -666,23 +736,27 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createTempSetFunction(
|
SceneStaticFunction _createTempSetFunction(Action action, bool isAutomation,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Smart AC Thermostat - Grey - Model A',
|
'Smart AC Thermostat - Grey - Model A',
|
||||||
Assets.assetsIconsAC,
|
Assets.assetsIconsAC,
|
||||||
'Set Temperature',
|
'Set Temperature',
|
||||||
isAutomation ? OperationDialogType.integerSteps : OperationDialogType.temperature,
|
isAutomation
|
||||||
isAutomation ? _createAutomationTemperatureOptions() : _createTemperatureOptions(),
|
? OperationDialogType.integerSteps
|
||||||
|
: OperationDialogType.temperature,
|
||||||
|
isAutomation
|
||||||
|
? _createAutomationTemperatureOptions()
|
||||||
|
: _createTemperatureOptions(),
|
||||||
isAutomation,
|
isAutomation,
|
||||||
comparator,
|
comparator,
|
||||||
uniqueCustomId,
|
uniqueCustomId,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createTempCurrentFunction(
|
SceneStaticFunction _createTempCurrentFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Smart AC Thermostat - Grey - Model A',
|
'Smart AC Thermostat - Grey - Model A',
|
||||||
@ -696,8 +770,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createModeFunction(
|
SceneStaticFunction _createModeFunction(Action action, bool isAutomation,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Smart AC Thermostat - Grey - Model A',
|
'Smart AC Thermostat - Grey - Model A',
|
||||||
@ -711,8 +785,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createLevelFunction(
|
SceneStaticFunction _createLevelFunction(Action action, bool isAutomation,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Smart AC Thermostat - Grey - Model A',
|
'Smart AC Thermostat - Grey - Model A',
|
||||||
@ -726,8 +800,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createChildLockFunction(
|
SceneStaticFunction _createChildLockFunction(Action action, bool isAutomation,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Smart AC Thermostat - Grey - Model A',
|
'Smart AC Thermostat - Grey - Model A',
|
||||||
@ -741,23 +815,38 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createSwitch1Function(
|
SceneStaticFunction _createSwitch1Function(Action action, bool isAutomation,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
switch (action.productType) {
|
||||||
action,
|
case "3G":
|
||||||
'3 Gang Button Switch L-L',
|
return _createSceneFunction(
|
||||||
Assets.assetsIcons3GangSwitch,
|
action,
|
||||||
'Light 1 Switch',
|
'3 Gang Button Switch L-L',
|
||||||
OperationDialogType.onOff,
|
Assets.assetsIcons3GangSwitch,
|
||||||
_createOnOffOptions(),
|
'Light 1 Switch',
|
||||||
isAutomation,
|
OperationDialogType.onOff,
|
||||||
comparator,
|
_createOnOffOptions(),
|
||||||
uniqueCustomId,
|
isAutomation,
|
||||||
);
|
comparator,
|
||||||
|
uniqueCustomId,
|
||||||
|
);
|
||||||
|
default:
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'1 Gang Button Switch L-L',
|
||||||
|
Assets.oneGang,
|
||||||
|
'Light Switch',
|
||||||
|
OperationDialogType.onOff,
|
||||||
|
_createOnOffOptions(),
|
||||||
|
isAutomation,
|
||||||
|
comparator,
|
||||||
|
uniqueCustomId,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createSwitch2Function(
|
SceneStaticFunction _createSwitch2Function(Action action, bool isAutomation,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'3 Gang Button Switch L-L',
|
'3 Gang Button Switch L-L',
|
||||||
@ -771,8 +860,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createSwitch3Function(
|
SceneStaticFunction _createSwitch3Function(Action action, bool isAutomation,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'3 Gang Button Switch L-L',
|
'3 Gang Button Switch L-L',
|
||||||
@ -786,53 +875,84 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createCountdown1Function(
|
SceneStaticFunction _createCountdown1Function(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
switch (action.productType) {
|
||||||
action,
|
case "3G":
|
||||||
'3 Gang Button Switch L-L',
|
return _createSceneFunction(
|
||||||
Assets.assetsIcons3GangSwitch,
|
action,
|
||||||
'Light 1 CountDown',
|
'3 Gang Button Switch L-L',
|
||||||
isAutomation ? OperationDialogType.integerSteps : OperationDialogType.countdown,
|
Assets.assetsIcons3GangSwitch,
|
||||||
isAutomation ? _createAutomationCountDownOptions() : _createCountdownOptions(),
|
'Light 1 CountDown',
|
||||||
isAutomation,
|
isAutomation
|
||||||
comparator,
|
? OperationDialogType.integerSteps
|
||||||
uniqueCustomId,
|
: OperationDialogType.countdown,
|
||||||
);
|
isAutomation
|
||||||
|
? _createAutomationCountDownOptions()
|
||||||
|
: _createCountdownOptions(),
|
||||||
|
isAutomation,
|
||||||
|
comparator,
|
||||||
|
uniqueCustomId,
|
||||||
|
);
|
||||||
|
default:
|
||||||
|
return _createSceneFunction(
|
||||||
|
action,
|
||||||
|
'1 Gang Button Switch L-L',
|
||||||
|
Assets.oneGang,
|
||||||
|
'Light CountDown',
|
||||||
|
isAutomation
|
||||||
|
? OperationDialogType.integerSteps
|
||||||
|
: OperationDialogType.countdown,
|
||||||
|
isAutomation
|
||||||
|
? _createAutomationCountDownOptions()
|
||||||
|
: _createCountdownOptions(),
|
||||||
|
isAutomation,
|
||||||
|
comparator,
|
||||||
|
uniqueCustomId,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createCountdown2Function(
|
SceneStaticFunction _createCountdown2Function(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'3 Gang Button Switch L-L',
|
'3 Gang Button Switch L-L',
|
||||||
Assets.assetsIcons3GangSwitch,
|
Assets.assetsIcons3GangSwitch,
|
||||||
'Light 2 CountDown',
|
'Light 2 CountDown',
|
||||||
isAutomation ? OperationDialogType.integerSteps : OperationDialogType.countdown,
|
isAutomation
|
||||||
isAutomation ? _createAutomationCountDownOptions() : _createCountdownOptions(),
|
? OperationDialogType.integerSteps
|
||||||
|
: OperationDialogType.countdown,
|
||||||
|
isAutomation
|
||||||
|
? _createAutomationCountDownOptions()
|
||||||
|
: _createCountdownOptions(),
|
||||||
isAutomation,
|
isAutomation,
|
||||||
comparator,
|
comparator,
|
||||||
uniqueCustomId,
|
uniqueCustomId,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createCountdown3Function(
|
SceneStaticFunction _createCountdown3Function(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'3 Gang Button Switch L-L',
|
'3 Gang Button Switch L-L',
|
||||||
Assets.assetsIcons3GangSwitch,
|
Assets.assetsIcons3GangSwitch,
|
||||||
'Light 3 CountDown',
|
'Light 3 CountDown',
|
||||||
isAutomation ? OperationDialogType.integerSteps : OperationDialogType.countdown,
|
isAutomation
|
||||||
isAutomation ? _createAutomationCountDownOptions() : _createCountdownOptions(),
|
? OperationDialogType.integerSteps
|
||||||
|
: OperationDialogType.countdown,
|
||||||
|
isAutomation
|
||||||
|
? _createAutomationCountDownOptions()
|
||||||
|
: _createCountdownOptions(),
|
||||||
isAutomation,
|
isAutomation,
|
||||||
comparator,
|
comparator,
|
||||||
uniqueCustomId,
|
uniqueCustomId,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createSwitchAlarmSoundFunction(
|
SceneStaticFunction _createSwitchAlarmSoundFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Gateway',
|
'Gateway',
|
||||||
@ -846,8 +966,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createMasterStateFunction(
|
SceneStaticFunction _createMasterStateFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Gateway',
|
'Gateway',
|
||||||
@ -861,8 +981,8 @@ mixin SceneOperationsDataHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneStaticFunction _createFactoryResetFunction(
|
SceneStaticFunction _createFactoryResetFunction(Action action,
|
||||||
Action action, bool isAutomation, String? comparator, String? uniqueCustomId) {
|
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||||
return _createSceneFunction(
|
return _createSceneFunction(
|
||||||
action,
|
action,
|
||||||
'Gateway',
|
'Gateway',
|
||||||
@ -1180,8 +1300,12 @@ mixin SceneOperationsDataHelper {
|
|||||||
uniqueCustomId: taskItem.uniqueCustomId,
|
uniqueCustomId: taskItem.uniqueCustomId,
|
||||||
deviceId: taskItem.deviceId,
|
deviceId: taskItem.deviceId,
|
||||||
deviceName: taskItem.deviceName.toString(),
|
deviceName: taskItem.deviceName.toString(),
|
||||||
deviceIcon: taskItem.operationName == 'automation' ? Assets.player : Assets.handClickIcon,
|
deviceIcon: taskItem.operationName == 'automation'
|
||||||
icon: taskItem.operationName == 'automation' ? Assets.player : Assets.handClickIcon,
|
? Assets.player
|
||||||
|
: Assets.handClickIcon,
|
||||||
|
icon: taskItem.operationName == 'automation'
|
||||||
|
? Assets.player
|
||||||
|
: Assets.handClickIcon,
|
||||||
operationName: taskItem.operationName,
|
operationName: taskItem.operationName,
|
||||||
operationDialogType: OperationDialogType.onOff,
|
operationDialogType: OperationDialogType.onOff,
|
||||||
functionValue: taskItem.functionValue == 'rule_enable' ? true : false,
|
functionValue: taskItem.functionValue == 'rule_enable' ? true : false,
|
||||||
|
|||||||
@ -74,6 +74,7 @@ class Action {
|
|||||||
ExecutorProperty? executorProperty;
|
ExecutorProperty? executorProperty;
|
||||||
String? name;
|
String? name;
|
||||||
String? type;
|
String? type;
|
||||||
|
String? productType;
|
||||||
|
|
||||||
Action({
|
Action({
|
||||||
required this.actionExecutor,
|
required this.actionExecutor,
|
||||||
@ -81,6 +82,7 @@ class Action {
|
|||||||
this.executorProperty,
|
this.executorProperty,
|
||||||
this.name,
|
this.name,
|
||||||
this.type,
|
this.type,
|
||||||
|
this.productType,
|
||||||
});
|
});
|
||||||
|
|
||||||
String toRawJson() => json.encode(toJson());
|
String toRawJson() => json.encode(toJson());
|
||||||
@ -88,10 +90,11 @@ class Action {
|
|||||||
static Action? fromJson(Map<String, dynamic> json) {
|
static Action? fromJson(Map<String, dynamic> json) {
|
||||||
if (json['name'] != null && json['type'] != null) {
|
if (json['name'] != null && json['type'] != null) {
|
||||||
return Action(
|
return Action(
|
||||||
actionExecutor: json["actionExecutor"],
|
actionExecutor: json["actionExecutor"] as String,
|
||||||
entityId: json["entityId"],
|
entityId: json["entityId"] as String,
|
||||||
name: json['name'],
|
name: json['name'] as String?,
|
||||||
type: json['type'],
|
type: json['type'] as String?,
|
||||||
|
productType: json['productType'] as String?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (json["executorProperty"] == null) {
|
if (json["executorProperty"] == null) {
|
||||||
@ -99,9 +102,10 @@ class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Action(
|
return Action(
|
||||||
actionExecutor: json["actionExecutor"],
|
actionExecutor: json["actionExecutor"] as String,
|
||||||
entityId: json["entityId"],
|
entityId: json["entityId"] as String,
|
||||||
executorProperty: ExecutorProperty.fromJson(json["executorProperty"]),
|
executorProperty: ExecutorProperty.fromJson(json["executorProperty"]),
|
||||||
|
productType: json['productType'] as String?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user