From 5142fc57f92c1c9c03447e6b67868a1224955576 Mon Sep 17 00:00:00 2001 From: ashrafzarkanisala Date: Sun, 14 Jul 2024 21:39:44 +0300 Subject: [PATCH] push devices automation functions --- .../automation_functions/current_temp.svg | 11 + .../automation_functions/motion.svg | 14 + .../automation_functions/presence.svg | 18 + .../automation_functions/self_test_result.svg | 23 + .../functions_per_device/ac_functions.dart | 265 +++ .../door_lock_functions.dart | 240 +++ .../gateway_functions.dart | 62 + .../human_presence_functions.dart | 174 ++ .../functions_per_device/presence_sensor.dart | 181 ++ .../three_gang_functions.dart | 92 + .../helper/scene_operations_data_helper.dart | 1919 ++++++----------- .../scene/view/create_scene_view.dart | 1 + .../scene/view/device_functions_view.dart | 30 +- .../if_then_containers/if_container.dart | 74 +- .../scene_devices/scene_devices_body.dart | 9 +- lib/generated/assets.dart | 20 + 16 files changed, 1855 insertions(+), 1278 deletions(-) create mode 100644 assets/icons/functions_icons/automation_functions/current_temp.svg create mode 100644 assets/icons/functions_icons/automation_functions/motion.svg create mode 100644 assets/icons/functions_icons/automation_functions/presence.svg create mode 100644 assets/icons/functions_icons/automation_functions/self_test_result.svg create mode 100644 lib/features/scene/helper/functions_per_device/ac_functions.dart create mode 100644 lib/features/scene/helper/functions_per_device/door_lock_functions.dart create mode 100644 lib/features/scene/helper/functions_per_device/gateway_functions.dart create mode 100644 lib/features/scene/helper/functions_per_device/human_presence_functions.dart create mode 100644 lib/features/scene/helper/functions_per_device/presence_sensor.dart create mode 100644 lib/features/scene/helper/functions_per_device/three_gang_functions.dart diff --git a/assets/icons/functions_icons/automation_functions/current_temp.svg b/assets/icons/functions_icons/automation_functions/current_temp.svg new file mode 100644 index 0000000..42cceb2 --- /dev/null +++ b/assets/icons/functions_icons/automation_functions/current_temp.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/icons/functions_icons/automation_functions/motion.svg b/assets/icons/functions_icons/automation_functions/motion.svg new file mode 100644 index 0000000..8d69463 --- /dev/null +++ b/assets/icons/functions_icons/automation_functions/motion.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/icons/functions_icons/automation_functions/presence.svg b/assets/icons/functions_icons/automation_functions/presence.svg new file mode 100644 index 0000000..d71a474 --- /dev/null +++ b/assets/icons/functions_icons/automation_functions/presence.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/functions_icons/automation_functions/self_test_result.svg b/assets/icons/functions_icons/automation_functions/self_test_result.svg new file mode 100644 index 0000000..8739327 --- /dev/null +++ b/assets/icons/functions_icons/automation_functions/self_test_result.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/features/scene/helper/functions_per_device/ac_functions.dart b/lib/features/scene/helper/functions_per_device/ac_functions.dart new file mode 100644 index 0000000..b295696 --- /dev/null +++ b/lib/features/scene/helper/functions_per_device/ac_functions.dart @@ -0,0 +1,265 @@ +import 'package:syncrow_app/features/scene/enum/ac_values.dart'; +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'; +import 'package:syncrow_app/utils/resource_manager/constants.dart'; + +class ACFunctionsHelper { + static List tabToRunAcFunctions( + String deviceId, String deviceName, functionValue) { + return [ + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsAcPower, + operationName: 'Power', + code: 'switch', + 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.assetsFreezing, + operationName: 'Mode', + code: 'mode', + functionValue: functionValue, + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcCooling, + description: AcValuesEnums.Cooling.name, + value: TempModes.cold.name, + ), + SceneOperationalValue( + icon: Assets.assetsAcHeating, + description: AcValuesEnums.Heating.name, + value: TempModes.hot.name, + ), + SceneOperationalValue( + icon: Assets.assetsFanSpeed, + description: AcValuesEnums.Ventilation.name, + value: TempModes.wind.name, + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsTempreture, + operationName: 'Set Temperature', + code: 'temp_set', + functionValue: functionValue, + operationDialogType: OperationDialogType.temperature, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsCelsiusDegrees, + value: 0, + description: 'COOL TO', + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsFanSpeed, + operationName: 'Fan Speed', + code: 'level', + functionValue: functionValue, + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcFanLow, + description: ValueACRange.LOW.name, + value: FanSpeeds.low.name, + ), + SceneOperationalValue( + icon: Assets.assetsAcFanMiddle, + description: ValueACRange.MIDDLE.name, + value: FanSpeeds.middle.name, + ), + SceneOperationalValue( + icon: Assets.assetsAcFanHigh, + description: ValueACRange.HIGH.name, + value: FanSpeeds.high.name, + ), + SceneOperationalValue( + icon: Assets.assetsAcFanAuto, + description: ValueACRange.AUTO.name, + value: FanSpeeds.auto.name, + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsChildLock, + operationName: 'Child Lock', + code: 'child_lock', + functionValue: functionValue, + operationDialogType: OperationDialogType.onOff, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsSceneChildLock, + description: 'Lock', + value: true, + ), + SceneOperationalValue( + icon: Assets.assetsSceneChildUnlock, + description: 'Unlock', + value: false, + ), + ], + ), + ]; + } + + static List automationAcFunctions( + String deviceId, String deviceName, functionValue) { + return [ + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsAcPower, + operationName: 'Power', + code: 'switch', + 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.assetsFreezing, + operationName: 'Mode', + code: 'mode', + functionValue: functionValue, + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcCooling, + description: AcValuesEnums.Cooling.name, + value: TempModes.cold.name, + ), + SceneOperationalValue( + icon: Assets.assetsAcHeating, + description: AcValuesEnums.Heating.name, + value: TempModes.hot.name, + ), + SceneOperationalValue( + icon: Assets.assetsFanSpeed, + description: AcValuesEnums.Ventilation.name, + value: TempModes.wind.name, + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsTempreture, + operationName: 'Set Temperature', + code: 'temp_set', + functionValue: functionValue, + operationDialogType: OperationDialogType.integerSteps, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsCelsiusDegrees, + value: 0, + description: 'COOL TO', + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsCurrentTemp, + operationName: 'Current Temperature', + code: 'temp_current', + functionValue: functionValue, + operationDialogType: OperationDialogType.integerSteps, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsCelsiusDegrees, + value: 0, + description: 'COOL TO', + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsFanSpeed, + operationName: 'Fan Speed', + code: 'level', + functionValue: functionValue, + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcFanLow, + description: ValueACRange.LOW.name, + value: FanSpeeds.low.name, + ), + SceneOperationalValue( + icon: Assets.assetsAcFanMiddle, + description: ValueACRange.MIDDLE.name, + value: FanSpeeds.middle.name, + ), + SceneOperationalValue( + icon: Assets.assetsAcFanHigh, + description: ValueACRange.HIGH.name, + value: FanSpeeds.high.name, + ), + SceneOperationalValue( + icon: Assets.assetsAcFanAuto, + description: ValueACRange.AUTO.name, + value: FanSpeeds.auto.name, + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsChildLock, + operationName: 'Child Lock', + code: 'child_lock', + functionValue: functionValue, + operationDialogType: OperationDialogType.onOff, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsSceneChildLock, + description: 'Lock', + value: true, + ), + SceneOperationalValue( + icon: Assets.assetsSceneChildUnlock, + description: 'Unlock', + value: false, + ), + ], + ), + ]; + } +} diff --git a/lib/features/scene/helper/functions_per_device/door_lock_functions.dart b/lib/features/scene/helper/functions_per_device/door_lock_functions.dart new file mode 100644 index 0000000..ac504b4 --- /dev/null +++ b/lib/features/scene/helper/functions_per_device/door_lock_functions.dart @@ -0,0 +1,240 @@ +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 DoorLockHelperFunctions { + /// tab to run functions + static List doorLockTapToRunFunctions( + String deviceId, String deviceName, functionValue) { + return [ + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsIconsDoorLock, + operationName: 'Set Door lock Normal Open', + functionValue: functionValue, + code: 'normal_open_switch', + operationDialogType: OperationDialogType.onOff, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcPower, description: "ON", value: true), + SceneOperationalValue( + icon: Assets.assetsAcPowerOFF, description: "OFF", value: false), + ], + ), + ]; + } + + //// automation functions + static List doorLockAutomationFunctions( + String deviceId, String deviceName, functionValue) { + return [ + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsFingerprintUnlock, + operationName: 'Fingerprint Unlock', + functionValue: functionValue, + code: 'unlock_fingerprint', + operationDialogType: OperationDialogType.integerSteps, + operationalValues: [ + SceneOperationalValue( + icon: '', + description: "", + value: 0, + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsPasswordUnlock, + operationName: 'Password Unlock', + functionValue: functionValue, + code: 'unlock_password', + operationDialogType: OperationDialogType.integerSteps, + operationalValues: [ + SceneOperationalValue( + icon: '', + description: "", + value: 0, + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsCardUnlock, + operationName: 'Card Unlock', + functionValue: functionValue, + code: 'unlock_card', + operationDialogType: OperationDialogType.integerSteps, + operationalValues: [ + SceneOperationalValue( + icon: '', + description: "", + value: 0, + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsLockAlarm, + operationName: 'Lock Alarm', + functionValue: functionValue, + code: 'alarm_lock', + operationDialogType: OperationDialogType.none, + operationalValues: [], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsRemoteUnlockReq, + operationName: 'Remote Unlock Request', + functionValue: functionValue, + code: 'unlock_request', + operationDialogType: OperationDialogType.integerSteps, + operationalValues: [ + SceneOperationalValue( + icon: '', + description: "", + value: 0, + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsResidualElectricity, + operationName: 'Residual Electricity', + functionValue: functionValue, + code: 'residual_electricity', + operationDialogType: OperationDialogType.integerSteps, + operationalValues: [ + SceneOperationalValue( + icon: '', + description: "", + value: 0, + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsDoubleLock, + operationName: 'Double Lock', + functionValue: functionValue, + operationDialogType: OperationDialogType.onOff, + code: 'reverse_lock', + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcPower, + description: "ON", + value: true, + ), + SceneOperationalValue( + icon: Assets.assetsAcPowerOFF, + description: "OFF", + value: false, + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsRemoteUnlockViaApp, + operationName: 'Remote Unlock Via App', + functionValue: functionValue, + operationDialogType: OperationDialogType.integerSteps, + code: 'unlock_app', + operationalValues: [ + SceneOperationalValue( + icon: '', + description: "", + value: 0, + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsHijackAlarm, + operationName: 'Hijack Alarm', + functionValue: functionValue, + operationDialogType: OperationDialogType.onOff, + code: 'hijack', + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcPower, + description: "ON", + value: true, + ), + SceneOperationalValue( + icon: Assets.assetsAcPowerOFF, + description: "OFF", + value: false, + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsDoorlockNormalOpen, + operationName: 'Set Door Lock Normal Open', + functionValue: functionValue, + code: 'normal_open_switch', + 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.assetsDoorlockNormalOpen, + operationName: 'Doorbell', + functionValue: functionValue, + code: 'doorbell', + 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.assetsTempPasswordUnlock, + operationName: 'Temporary Password Unlock', + functionValue: functionValue, + operationDialogType: OperationDialogType.integerSteps, + code: 'unlock_temporary', + operationalValues: [ + SceneOperationalValue( + icon: '', + description: "", + value: 0, + ), + ], + ), + ]; + } +} diff --git a/lib/features/scene/helper/functions_per_device/gateway_functions.dart b/lib/features/scene/helper/functions_per_device/gateway_functions.dart new file mode 100644 index 0000000..7a356a7 --- /dev/null +++ b/lib/features/scene/helper/functions_per_device/gateway_functions.dart @@ -0,0 +1,62 @@ +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 GatewayHelperFunctions { + static List tabToRunGatewayFunctions( + String deviceId, String deviceName, functionValue) { + return [ + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsSwitchAlarmSound, + operationName: 'Switch Alarm Sound', + code: 'switch_alarm_sound', + 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.assetsMasterState, + operationName: 'Master State', + code: 'master_state', + functionValue: functionValue, + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcPower, + description: "Alarm", + value: 'alarm', + ), + SceneOperationalValue( + icon: Assets.assetsAcPowerOFF, + description: "Normal", + value: 'normal', + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsFactoryReset, + operationName: 'Factory Reset', + code: 'factory_reset', + functionValue: functionValue, + operationDialogType: OperationDialogType.onOff, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsSceneRefresh, description: "ON", value: true), + SceneOperationalValue( + icon: Assets.assetsResetOff, description: "OFF", value: false), + ], + ), + ]; + } +} diff --git a/lib/features/scene/helper/functions_per_device/human_presence_functions.dart b/lib/features/scene/helper/functions_per_device/human_presence_functions.dart new file mode 100644 index 0000000..f29431a --- /dev/null +++ b/lib/features/scene/helper/functions_per_device/human_presence_functions.dart @@ -0,0 +1,174 @@ +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 HumanPresenceHelperFunctions { + static List tabToRunHumanPresenceFunctions( + String deviceId, String deviceName, functionValue) { + return [ + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsFarDetection, + operationName: 'Far Detection', + code: 'far_detection', + functionValue: functionValue, + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 75, + description: '75cm', + iconValue: '75', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 150, + description: '150cm', + iconValue: '150', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 225, + description: '225cm', + iconValue: '225', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 300, + description: '300cm', + iconValue: '300', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 375, + description: '375cm', + iconValue: '375', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 450, + description: '450cm', + iconValue: '450', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 525, + description: '525cm', + iconValue: '525', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 600, + description: '600cm', + iconValue: '600', + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsMotionDetection, + operationName: 'Motion Detection Sensitivity', + code: 'motion_sensitivity_value', + functionValue: functionValue, + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 1, + description: 1.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 2, + description: 2.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 3, + description: 3.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 4, + description: 4.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 5, + description: 5.toString(), + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsMotionlessDetection, + operationName: 'Motionless Detection Sensitivity', + code: 'motionless_sensitivity', + functionValue: functionValue, + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + iconValue: '1', + icon: Assets.assetsFarDetectionFunction, + value: 1, + description: '1', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 2, + description: '2', + iconValue: '2', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 3, + description: '3', + iconValue: '3', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 4, + description: '4', + iconValue: '4', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 5, + description: '5', + iconValue: '5', + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsIndicator, + operationName: 'Indicator', + code: 'indicator', + 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.assetsNobodyTime, + operationName: 'Nobody Time', + code: 'presence_time', + functionValue: functionValue, + operationDialogType: OperationDialogType.countdown, + operationalValues: [ + SceneOperationalValue(icon: '', value: 0), + ], + ), + ]; + } +} diff --git a/lib/features/scene/helper/functions_per_device/presence_sensor.dart b/lib/features/scene/helper/functions_per_device/presence_sensor.dart new file mode 100644 index 0000000..fcd30b1 --- /dev/null +++ b/lib/features/scene/helper/functions_per_device/presence_sensor.dart @@ -0,0 +1,181 @@ +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 PresenceSensorHelperFunctions { + static List tabToRunPresenceSensorFunctions( + String deviceId, String deviceName, functionValue) { + return [ + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsSensitivityFunction, + operationName: 'Sensitivity', + code: 'sensitivity', + functionValue: functionValue, + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 1, + description: 1.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 2, + description: 2.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 3, + description: 3.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 4, + description: 4.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 5, + description: 5.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 6, + description: 6.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 7, + description: 7.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 8, + description: 8.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 9, + description: 9.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 10, + description: 10.toString(), + ), + ], + ), + ]; + } + + static List automationPresenceSensorFunctions( + String deviceId, String deviceName, functionValue) { + return [ + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsIconsSensors, + operationName: 'Presence Status', + code: 'presence_state', + functionValue: functionValue, + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsIconsPresenceSensorAssetsEmpty, + value: 'none', + description: 'None', + ), + SceneOperationalValue( + icon: Assets.assetsPresence, + value: 'presence', + description: 'Presence', + ), + SceneOperationalValue( + icon: Assets.assetsMotion, + value: 'motion', + description: 'Motion', + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsSensitivityFunction, + operationName: 'Sensitivity', + code: 'sensitivity', + functionValue: functionValue, + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 1, + description: 1.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 2, + description: 2.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 3, + description: 3.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 4, + description: 4.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 5, + description: 5.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 6, + description: 6.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 7, + description: 7.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 8, + description: 8.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 9, + description: 9.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 10, + description: 10.toString(), + ), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsSelfTestResult, + operationName: 'Self-Test Result', + code: 'checking_result', + functionValue: functionValue, + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsSelfTestResult, + value: 'check_success', + description: 'Self Testing Success', + ), + ], + ), + ]; + } +} diff --git a/lib/features/scene/helper/functions_per_device/three_gang_functions.dart b/lib/features/scene/helper/functions_per_device/three_gang_functions.dart new file mode 100644 index 0000000..6c0d9c9 --- /dev/null +++ b/lib/features/scene/helper/functions_per_device/three_gang_functions.dart @@ -0,0 +1,92 @@ +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 ThreeGangHelperFunctions { + static List threeGangHelperFunctions( + String deviceId, String deviceName, functionValue) { + return [ + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsAcPower, + operationName: 'Light 1 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.assetsAcPower, + operationName: 'Light 2 Switch', + code: 'switch_2', + 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.assetsAcPower, + operationName: 'Light 3 Switch', + code: 'switch_3', + 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 1 CountDown', + code: 'countdown_1', + functionValue: functionValue, + operationDialogType: OperationDialogType.countdown, + operationalValues: [ + SceneOperationalValue(icon: '', value: 0), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsLightCountdown, + operationName: 'Light 2 CountDown', + code: 'countdown_2', + functionValue: functionValue, + operationDialogType: OperationDialogType.countdown, + operationalValues: [ + SceneOperationalValue(icon: '', value: 0), + ], + ), + SceneStaticFunction( + deviceId: deviceId, + deviceName: deviceName, + icon: Assets.assetsLightCountdown, + operationName: 'Light 3 CountDown', + code: 'countdown_3', + functionValue: functionValue, + operationDialogType: OperationDialogType.countdown, + operationalValues: [ + SceneOperationalValue(icon: '', value: 0), + ], + ), + ]; + } +} diff --git a/lib/features/scene/helper/scene_operations_data_helper.dart b/lib/features/scene/helper/scene_operations_data_helper.dart index a93bcfd..037d2be 100644 --- a/lib/features/scene/helper/scene_operations_data_helper.dart +++ b/lib/features/scene/helper/scene_operations_data_helper.dart @@ -1,6 +1,12 @@ import 'package:syncrow_app/features/devices/model/function_model.dart'; import 'package:syncrow_app/features/scene/enum/ac_values.dart'; import 'package:syncrow_app/features/scene/enum/operation_dialog_type.dart'; +import 'package:syncrow_app/features/scene/helper/functions_per_device/ac_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/human_presence_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/three_gang_functions.dart'; import 'package:syncrow_app/features/scene/model/scene_details_model.dart'; import 'package:syncrow_app/features/scene/model/scene_static_function.dart'; import 'package:syncrow_app/generated/assets.dart'; @@ -121,69 +127,12 @@ mixin SceneOperationsDataHelper { required dynamic functionValue, required bool isAutomation, }) { - return [ - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsSensitivityFunction, - operationName: 'Sensitivity', - code: 'sensitivity', - functionValue: functionValue, - operationDialogType: OperationDialogType.listOfOptions, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 1, - description: 1.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 2, - description: 2.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 3, - description: 3.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 4, - description: 4.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 5, - description: 5.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 6, - description: 6.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 7, - description: 7.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 8, - description: 8.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 9, - description: 9.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 10, - description: 10.toString(), - ), - ], - ), - ]; + if (isAutomation) { + return PresenceSensorHelperFunctions.automationPresenceSensorFunctions( + deviceId, deviceName, functionValue); + } + return PresenceSensorHelperFunctions.tabToRunPresenceSensorFunctions( + deviceId, deviceName, functionValue); } List curtainFunctions( @@ -203,232 +152,11 @@ mixin SceneOperationsDataHelper { required bool isAutomation, }) { if (isAutomation) { - return [ - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsFingerprintUnlock, - operationName: 'Fingerprint Unlock', - functionValue: functionValue, - code: 'unlock_fingerprint', - operationDialogType: OperationDialogType.integerSteps, - operationalValues: [ - SceneOperationalValue( - icon: '', - description: "", - value: 0, - ), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsPasswordUnlock, - operationName: 'Password Unlock', - functionValue: functionValue, - code: 'unlock_password', - operationDialogType: OperationDialogType.integerSteps, - operationalValues: [ - SceneOperationalValue( - icon: '', - description: "", - value: 0, - ), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsCardUnlock, - operationName: 'Card Unlock', - functionValue: functionValue, - code: 'unlock_card', - operationDialogType: OperationDialogType.integerSteps, - operationalValues: [ - SceneOperationalValue( - icon: '', - description: "", - value: 0, - ), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsLockAlarm, - operationName: 'Lock Alarm', - functionValue: functionValue, - code: 'alarm_lock', - operationDialogType: OperationDialogType.none, - operationalValues: [], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsRemoteUnlockReq, - operationName: 'Remote Unlock Request', - functionValue: functionValue, - code: 'unlock_request', - operationDialogType: OperationDialogType.integerSteps, - operationalValues: [ - SceneOperationalValue( - icon: '', - description: "", - value: 0, - ), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsResidualElectricity, - operationName: 'Residual Electricity', - functionValue: functionValue, - code: 'residual_electricity', - operationDialogType: OperationDialogType.integerSteps, - operationalValues: [ - SceneOperationalValue( - icon: '', - description: "", - value: 0, - ), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsDoubleLock, - operationName: 'Double Lock', - functionValue: functionValue, - operationDialogType: OperationDialogType.onOff, - code: 'reverse_lock', - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsAcPower, - description: "ON", - value: true, - ), - SceneOperationalValue( - icon: Assets.assetsAcPowerOFF, - description: "OFF", - value: false, - ), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsRemoteUnlockViaApp, - operationName: 'Remote Unlock Via App', - functionValue: functionValue, - operationDialogType: OperationDialogType.integerSteps, - code: 'unlock_app', - operationalValues: [ - SceneOperationalValue( - icon: '', - description: "", - value: 0, - ), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsHijackAlarm, - operationName: 'Hijack Alarm', - functionValue: functionValue, - operationDialogType: OperationDialogType.onOff, - code: 'hijack', - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsAcPower, - description: "ON", - value: true, - ), - SceneOperationalValue( - icon: Assets.assetsAcPowerOFF, - description: "OFF", - value: false, - ), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsDoorlockNormalOpen, - operationName: 'Set Door Lock Normal Open', - functionValue: functionValue, - code: 'normal_open_switch', - 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.assetsDoorlockNormalOpen, - operationName: 'Doorbell', - functionValue: functionValue, - code: 'doorbell', - 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.assetsTempPasswordUnlock, - operationName: 'Temporary Password Unlock', - functionValue: functionValue, - operationDialogType: OperationDialogType.integerSteps, - code: 'unlock_temporary', - operationalValues: [ - SceneOperationalValue( - icon: '', - description: "", - value: 0, - ), - ], - ), - ]; + return DoorLockHelperFunctions.doorLockAutomationFunctions( + deviceId, deviceName, functionValue); } - return [ - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsIconsDoorLock, - operationName: 'Set Door lock Normal Open', - functionValue: functionValue, - code: 'normal_open_switch', - operationDialogType: OperationDialogType.onOff, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsAcPower, description: "ON", value: true), - SceneOperationalValue( - icon: Assets.assetsAcPowerOFF, description: "OFF", value: false), - ], - ), - ]; + return DoorLockHelperFunctions.doorLockTapToRunFunctions( + deviceId, deviceName, functionValue); } List wallSensorFunctions({ @@ -438,171 +166,8 @@ mixin SceneOperationsDataHelper { required functionValue, required bool isAutomation, }) { - return [ - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsFarDetection, - operationName: 'Far Detection', - code: 'far_detection', - functionValue: functionValue, - operationDialogType: OperationDialogType.listOfOptions, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 75, - description: '75cm', - iconValue: '75', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 150, - description: '150cm', - iconValue: '150', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 225, - description: '225cm', - iconValue: '225', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 300, - description: '300cm', - iconValue: '300', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 375, - description: '375cm', - iconValue: '375', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 450, - description: '450cm', - iconValue: '450', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 525, - description: '525cm', - iconValue: '525', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 600, - description: '600cm', - iconValue: '600', - ), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsMotionDetection, - operationName: 'Motion Detection Sensitivity', - code: 'motion_sensitivity_value', - functionValue: functionValue, - operationDialogType: OperationDialogType.listOfOptions, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 1, - description: 1.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 2, - description: 2.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 3, - description: 3.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 4, - description: 4.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 5, - description: 5.toString(), - ), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsMotionlessDetection, - operationName: 'Motionless Detection Sensitivity', - code: 'motionless_sensitivity', - functionValue: functionValue, - operationDialogType: OperationDialogType.listOfOptions, - operationalValues: [ - SceneOperationalValue( - iconValue: '1', - icon: Assets.assetsFarDetectionFunction, - value: 1, - description: '1', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 2, - description: '2', - iconValue: '2', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 3, - description: '3', - iconValue: '3', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 4, - description: '4', - iconValue: '4', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 5, - description: '5', - iconValue: '5', - ), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsIndicator, - operationName: 'Indicator', - code: 'indicator', - 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.assetsNobodyTime, - operationName: 'Nobody Time', - code: 'presence_time', - functionValue: functionValue, - operationDialogType: OperationDialogType.countdown, - operationalValues: [ - SceneOperationalValue(icon: '', value: 0), - ], - ), - ]; + return HumanPresenceHelperFunctions.tabToRunHumanPresenceFunctions( + deviceId, deviceName, functionValue); } List lightBulbFunctions( @@ -621,59 +186,8 @@ mixin SceneOperationsDataHelper { required functionValue, required bool isAutomation, }) { - return [ - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsSwitchAlarmSound, - operationName: 'Switch Alarm Sound', - code: 'switch_alarm_sound', - 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.assetsMasterState, - operationName: 'Master State', - code: 'master_state', - functionValue: functionValue, - operationDialogType: OperationDialogType.listOfOptions, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsAcPower, - description: "Alarm", - value: 'alarm', - ), - SceneOperationalValue( - icon: Assets.assetsAcPowerOFF, - description: "Normal", - value: 'normal', - ), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsFactoryReset, - operationName: 'Factory Reset', - code: 'factory_reset', - functionValue: functionValue, - operationDialogType: OperationDialogType.onOff, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsSceneRefresh, description: "ON", value: true), - SceneOperationalValue( - icon: Assets.assetsResetOff, description: "OFF", value: false), - ], - ), - ]; + return GatewayHelperFunctions.tabToRunGatewayFunctions( + deviceId, deviceName, functionValue); } List threeGangFunctions({ @@ -683,89 +197,8 @@ mixin SceneOperationsDataHelper { required functionValue, required bool isAutomation, }) { - return [ - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsAcPower, - operationName: 'Light 1 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.assetsAcPower, - operationName: 'Light 2 Switch', - code: 'switch_2', - 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.assetsAcPower, - operationName: 'Light 3 Switch', - code: 'switch_3', - 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 1 CountDown', - code: 'countdown_1', - functionValue: functionValue, - operationDialogType: OperationDialogType.countdown, - operationalValues: [ - SceneOperationalValue(icon: '', value: 0), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsLightCountdown, - operationName: 'Light 2 CountDown', - code: 'countdown_2', - functionValue: functionValue, - operationDialogType: OperationDialogType.countdown, - operationalValues: [ - SceneOperationalValue(icon: '', value: 0), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsLightCountdown, - operationName: 'Light 3 CountDown', - code: 'countdown_3', - functionValue: functionValue, - operationDialogType: OperationDialogType.countdown, - operationalValues: [ - SceneOperationalValue(icon: '', value: 0), - ], - ), - ]; + return ThreeGangHelperFunctions.threeGangHelperFunctions( + deviceId, deviceName, functionValue); } /// smart ac thermostat @@ -776,123 +209,12 @@ mixin SceneOperationsDataHelper { required functionValue, required bool isAutomation, }) { - return [ - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsAcPower, - operationName: 'Power', - code: 'switch', - 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.assetsFreezing, - operationName: 'Mode', - code: 'mode', - functionValue: functionValue, - operationDialogType: OperationDialogType.listOfOptions, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsAcCooling, - description: AcValuesEnums.Cooling.name, - value: TempModes.cold.name, - ), - SceneOperationalValue( - icon: Assets.assetsAcHeating, - description: AcValuesEnums.Heating.name, - value: TempModes.hot.name, - ), - SceneOperationalValue( - icon: Assets.assetsFanSpeed, - description: AcValuesEnums.Ventilation.name, - value: TempModes.wind.name, - ), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsTempreture, - operationName: 'Set Temperature', - code: 'temp_set', - functionValue: functionValue, - operationDialogType: OperationDialogType.temperature, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsCelsiusDegrees, - value: 0, - description: 'COOL TO', - ), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsFanSpeed, - operationName: 'Fan Speed', - code: 'level', - functionValue: functionValue, - operationDialogType: OperationDialogType.listOfOptions, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsAcFanLow, - description: ValueACRange.LOW.name, - value: FanSpeeds.low.name, - ), - SceneOperationalValue( - icon: Assets.assetsAcFanMiddle, - description: ValueACRange.MIDDLE.name, - value: FanSpeeds.middle.name, - ), - SceneOperationalValue( - icon: Assets.assetsAcFanHigh, - description: ValueACRange.HIGH.name, - value: FanSpeeds.high.name, - ), - SceneOperationalValue( - icon: Assets.assetsAcFanAuto, - description: ValueACRange.AUTO.name, - value: FanSpeeds.auto.name, - ), - ], - ), - SceneStaticFunction( - deviceId: deviceId, - deviceName: deviceName, - icon: Assets.assetsChildLock, - operationName: 'Child Lock', - code: 'child_lock', - functionValue: functionValue, - operationDialogType: OperationDialogType.onOff, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsSceneChildLock, - description: 'Lock', - value: true, - ), - SceneOperationalValue( - icon: Assets.assetsSceneChildUnlock, - description: 'Unlock', - value: false, - ), - ], - ), - ]; + if (isAutomation) { + return ACFunctionsHelper.automationAcFunctions( + deviceId, deviceName, functionValue); + } + return ACFunctionsHelper.tabToRunAcFunctions( + deviceId, deviceName, functionValue); } ///////&************ END of get function with icons for device *************&&//////// @@ -1582,603 +904,720 @@ mixin SceneOperationsDataHelper { switch (taskItem.code) { case 'sensitivity': functions.add( - SceneStaticFunction( - deviceId: deviceId, - deviceName: 'Presence Sensor', - deviceIcon: Assets.assetsIconsSensors, - icon: Assets.assetsSensitivityFunction, - operationName: 'Sensitivity', - code: 'sensitivity', - functionValue: taskItem.functionValue, - operationDialogType: OperationDialogType.listOfOptions, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 1, - description: 1.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 2, - description: 2.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 3, - description: 3.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 4, - description: 4.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 5, - description: 5.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 6, - description: 6.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 7, - description: 7.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 8, - description: 8.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 9, - description: 9.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 10, - description: 10.toString(), - ), - ], - ), + sensitivityFunctionsBasedOnCodeMatch(deviceId, taskItem), ); break; case 'normal_open_switch': functions.add( - SceneStaticFunction( - deviceId: deviceId, - deviceName: 'WIFI LOCK PRO', - deviceIcon: Assets.assetsIconsDoorLock, - icon: Assets.assetsIconsDoorLock, - operationName: 'Set Door lock Normal Open', - functionValue: taskItem.functionValue, - code: 'normal_open_switch', - operationDialogType: OperationDialogType.onOff, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsAcPower, description: "ON", value: true), - SceneOperationalValue( - icon: Assets.assetsAcPowerOFF, - description: "OFF", - value: false, - ), - ], - ), + normalOpenSwitchBasedOnCodeMatch(deviceId, taskItem), ); break; case 'far_detection': functions.add( - SceneStaticFunction( - deviceId: deviceId, - deviceName: 'Human Presence Sensor', - deviceIcon: Assets.assetsIconsSensors, - icon: Assets.assetsFarDetection, - operationName: 'Far Detection', - functionValue: taskItem.functionValue, - code: 'far_detection', - operationDialogType: OperationDialogType.listOfOptions, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 75, - description: '75cm', - iconValue: '75', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 150, - description: '150cm', - iconValue: '150', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 225, - description: '225cm', - iconValue: '225', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 300, - description: '300cm', - iconValue: '300', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 375, - description: '375cm', - iconValue: '375', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 450, - description: '450cm', - iconValue: '450', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 525, - description: '525cm', - iconValue: '525', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 600, - description: '600cm', - iconValue: '600', - ), - ], - ), + farDetectionBasedOnCodeMatch(deviceId, taskItem), ); break; case 'motion_sensitivity_value': functions.add( - SceneStaticFunction( - deviceId: deviceId, - deviceName: 'Human Presence Sensor', - deviceIcon: Assets.assetsIconsSensors, - icon: Assets.assetsMotionDetection, - operationName: 'Motion Detection Sensitivity', - functionValue: taskItem.functionValue, - code: 'motion_sensitivity_value', - operationDialogType: OperationDialogType.listOfOptions, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 1, - description: 1.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 2, - description: 2.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 3, - description: 3.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 4, - description: 4.toString(), - ), - SceneOperationalValue( - icon: Assets.assetsSensitivityOperationIcon, - value: 5, - description: 5.toString(), - ), - ], - ), + motionSensitivityValueBasedOnCodeMatch(deviceId, taskItem), ); break; case 'motionless_sensitivity': functions.add( - SceneStaticFunction( - deviceId: deviceId, - deviceName: 'Human Presence Sensor', - deviceIcon: Assets.assetsIconsSensors, - icon: Assets.assetsMotionlessDetection, - operationName: 'Motionless Detection Sensitivity', - functionValue: taskItem.functionValue, - code: 'motion_sensitivity_value', - operationDialogType: OperationDialogType.listOfOptions, - operationalValues: [ - SceneOperationalValue( - iconValue: '1', - icon: Assets.assetsFarDetectionFunction, - value: 1, - description: '1', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 2, - description: '2', - iconValue: '2', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 3, - description: '3', - iconValue: '3', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 4, - description: '4', - iconValue: '4', - ), - SceneOperationalValue( - icon: Assets.assetsFarDetectionFunction, - value: 5, - description: '5', - iconValue: '5', - ), - ], - ), + motionlessSensitivityBasedOnCodeMatch(deviceId, taskItem), ); break; case 'indicator': functions.add( - SceneStaticFunction( - deviceId: deviceId, - deviceName: 'Human Presence Sensor', - deviceIcon: Assets.assetsIconsSensors, - icon: Assets.assetsIndicator, - operationName: 'Indicator', - functionValue: taskItem.functionValue, - code: 'indicator', - operationDialogType: OperationDialogType.onOff, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsAcPower, description: "ON", value: true), - SceneOperationalValue( - icon: Assets.assetsAcPowerOFF, - description: "OFF", - value: false, - ), - ], - ), + indicatorBasedOnCodeMatch(deviceId, taskItem), ); break; case 'presence_time': functions.add( - SceneStaticFunction( - deviceId: deviceId, - deviceName: 'Human Presence Sensor', - deviceIcon: Assets.assetsIconsSensors, - icon: Assets.assetsNobodyTime, - operationName: 'Nobody Time', - functionValue: taskItem.functionValue, - code: 'presence_time', - operationDialogType: OperationDialogType.temperature, - operationalValues: [ - SceneOperationalValue(icon: '', value: 0), - ], - ), + presenceTimeBasedOnCodeMatch(deviceId, taskItem), ); break; case 'switch_alarm_sound': functions.add( - SceneStaticFunction( - deviceId: deviceId, - deviceName: 'Multi-Mode Gateway Z-W-B', - deviceIcon: Assets.assetsIconsGateway, - icon: Assets.assetsSwitchAlarmSound, - operationName: 'Switch Alarm Sound', - functionValue: taskItem.functionValue, - code: 'switch_alarm_sound', - operationDialogType: OperationDialogType.onOff, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsAcPower, - description: "ON", - value: true, - ), - SceneOperationalValue( - icon: Assets.assetsAcPowerOFF, - description: "OFF", - value: false), - ], - ), + switchAlarmSoundBasedOnCodeMatch(deviceId, taskItem), ); break; case 'master_state': functions.add( - SceneStaticFunction( - deviceId: deviceId, - deviceName: 'Multi-Mode Gateway Z-W-B', - deviceIcon: Assets.assetsIconsGateway, - icon: Assets.assetsMasterState, - operationName: 'Master State', - functionValue: taskItem.functionValue, - code: 'master_state', - operationDialogType: OperationDialogType.listOfOptions, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsAcPower, - description: "Alarm", - value: 'alarm', - ), - SceneOperationalValue( - icon: Assets.assetsAcPowerOFF, - description: "Normal", - value: 'normal', - ), - ], - ), + masterStateBasedOnCodeMatch(deviceId, taskItem), ); break; case 'factory_reset': functions.add( - SceneStaticFunction( - deviceId: deviceId, - deviceName: 'Multi-Mode Gateway Z-W-B', - deviceIcon: Assets.assetsIconsGateway, - icon: Assets.assetsFactoryReset, - operationName: 'Reset Factory', - functionValue: taskItem.functionValue, - code: 'factory_reset', - operationDialogType: OperationDialogType.onOff, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsSceneRefresh, - description: "ON", - value: true), - SceneOperationalValue( - icon: Assets.assetsResetOff, - description: "OFF", - value: false, - ), - ], - ), + factoryResetBasedOnCodeMatch(deviceId, taskItem), ); break; case 'switch_1': - functions.add(SceneStaticFunction( - deviceId: deviceId, - deviceName: '3 Gang Button Switch L-L', - deviceIcon: Assets.assetsIcons3GangSwitch, - icon: Assets.assetsAcPower, - operationName: 'Light 1 Switch', - code: 'switch_1', - functionValue: taskItem.functionValue, - operationDialogType: OperationDialogType.onOff, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsAcPower, - description: "ON", - value: true, - ), - SceneOperationalValue( - icon: Assets.assetsAcPowerOFF, - description: "OFF", - value: false), - ], - )); + functions.add( + switch1BasedOnCodeMatch(deviceId, taskItem), + ); break; case 'switch_2': - functions.add(SceneStaticFunction( - deviceId: deviceId, - deviceName: '3 Gang Button Switch L-L', - deviceIcon: Assets.assetsIcons3GangSwitch, - icon: Assets.assetsAcPower, - operationName: 'Light 2 Switch', - code: 'switch_2', - functionValue: taskItem.functionValue, - operationDialogType: OperationDialogType.onOff, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsAcPower, description: "ON", value: true), - SceneOperationalValue( - icon: Assets.assetsAcPowerOFF, - description: "OFF", - value: false), - ], - )); + functions.add( + switch2BasedOnCodeMatch(deviceId, taskItem), + ); break; case 'switch_3': - functions.add(SceneStaticFunction( - deviceId: deviceId, - deviceName: '3 Gang Button Switch L-L', - deviceIcon: Assets.assetsIcons3GangSwitch, - icon: Assets.assetsAcPower, - operationName: 'Light 3 Switch', - code: 'switch_3', - functionValue: taskItem.functionValue, - operationDialogType: OperationDialogType.onOff, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsAcPower, description: "ON", value: true), - SceneOperationalValue( - icon: Assets.assetsAcPowerOFF, - description: "OFF", - value: false), - ], - )); + functions.add( + switch3BasedOnCodeMatch(deviceId, taskItem), + ); break; case 'countdown_1': - functions.add(SceneStaticFunction( - deviceId: deviceId, - deviceName: '3 Gang Button Switch L-L', - deviceIcon: Assets.assetsIcons3GangSwitch, - icon: Assets.assetsLightCountdown, - operationName: 'Light 1 CountDown', - code: 'countdown_1', - functionValue: taskItem.functionValue, - operationDialogType: OperationDialogType.countdown, - operationalValues: [ - SceneOperationalValue(icon: '', value: 0), - ], - )); + functions.add( + countdown1BasedOnCodeMatch(deviceId, taskItem), + ); break; case 'countdown_2': - functions.add(SceneStaticFunction( - deviceId: deviceId, - deviceName: '3 Gang Button Switch L-L', - deviceIcon: Assets.assetsIcons3GangSwitch, - icon: Assets.assetsLightCountdown, - operationName: 'Light 2 CountDown', - code: 'countdown_2', - functionValue: taskItem.functionValue, - operationDialogType: OperationDialogType.countdown, - operationalValues: [ - SceneOperationalValue(icon: '', value: 0), - ], - )); + functions.add( + countdown2BasedOnCodeMatch(deviceId, taskItem), + ); break; case 'countdown_3': - functions.add(SceneStaticFunction( - deviceId: deviceId, - deviceName: '3 Gang Button Switch L-L', - deviceIcon: Assets.assetsIcons3GangSwitch, - icon: Assets.assetsLightCountdown, - operationName: 'Light 3 CountDown', - code: 'countdown_3', - functionValue: taskItem.functionValue, - operationDialogType: OperationDialogType.countdown, - operationalValues: [ - SceneOperationalValue(icon: '', value: 0), - ], - )); + functions.add( + countdown3BasedOnCodeMatch(deviceId, taskItem), + ); break; case 'switch': - functions.add(SceneStaticFunction( - deviceId: deviceId, - deviceName: 'Smart AC Thermostat - Grey - Model A', - deviceIcon: Assets.assetsIconsAC, - icon: Assets.assetsAcPower, - operationName: 'Power', - code: 'switch', - functionValue: taskItem.functionValue, - operationDialogType: OperationDialogType.onOff, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsAcPower, - description: "ON", - value: true, - ), - SceneOperationalValue( - icon: Assets.assetsAcPowerOFF, - description: "OFF", - value: false, - ), - ], - )); + functions.add( + switchBasedOnCodeMatch(deviceId, taskItem), + ); break; case 'temp_set': - functions.add(SceneStaticFunction( - deviceId: deviceId, - deviceName: 'Smart AC Thermostat - Grey - Model A', - deviceIcon: Assets.assetsIconsAC, - icon: Assets.assetsTempreture, - operationName: 'Set Temperature', - code: 'temp_set', - functionValue: taskItem.functionValue != null - ? ((taskItem.functionValue / 10) as double).toInt() - : null, - operationDialogType: OperationDialogType.temperature, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsCelsiusDegrees, - value: 0, - description: 'COOL TO', - ), - ], - )); + functions.add( + tempSetBasedOnCodeMatch(deviceId, taskItem), + ); break; case 'mode': - functions.add(SceneStaticFunction( - deviceId: deviceId, - deviceName: 'Smart AC Thermostat - Grey - Model A', - deviceIcon: Assets.assetsIconsAC, - icon: Assets.assetsFreezing, - operationName: 'Mode', - code: 'mode', - functionValue: taskItem.functionValue, - operationDialogType: OperationDialogType.listOfOptions, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsAcCooling, - description: AcValuesEnums.Cooling.name, - value: TempModes.cold.name, - ), - SceneOperationalValue( - icon: Assets.assetsAcHeating, - description: AcValuesEnums.Heating.name, - value: TempModes.hot.name, - ), - SceneOperationalValue( - icon: Assets.assetsFanSpeed, - description: AcValuesEnums.Ventilation.name, - value: TempModes.wind.name, - ), - ], - )); + functions.add( + modeBasedOnCodeMatch(deviceId, taskItem), + ); break; case 'level': - functions.add(SceneStaticFunction( - deviceId: deviceId, - deviceName: 'Smart AC Thermostat - Grey - Model A', - deviceIcon: Assets.assetsIconsAC, - icon: Assets.assetsFanSpeed, - operationName: 'Fan Speed', - code: 'level', - functionValue: taskItem.functionValue, - operationDialogType: OperationDialogType.listOfOptions, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsAcFanLow, - description: ValueACRange.LOW.name, - value: FanSpeeds.low.name, - ), - SceneOperationalValue( - icon: Assets.assetsAcFanMiddle, - description: ValueACRange.MIDDLE.name, - value: FanSpeeds.middle.name, - ), - SceneOperationalValue( - icon: Assets.assetsAcFanHigh, - description: ValueACRange.HIGH.name, - value: FanSpeeds.high.name, - ), - SceneOperationalValue( - icon: Assets.assetsAcFanAuto, - description: ValueACRange.AUTO.name, - value: FanSpeeds.auto.name, - ), - ], - )); + functions.add( + levelBasedOnCodeMatch(deviceId, taskItem), + ); break; case 'child_lock': - functions.add(SceneStaticFunction( - deviceId: deviceId, - deviceName: 'Smart AC Thermostat - Grey - Model A', - deviceIcon: Assets.assetsIconsAC, - icon: Assets.assetsChildLock, - operationName: 'Child Lock', - code: 'child_lock', - functionValue: taskItem.functionValue, - operationDialogType: OperationDialogType.onOff, - operationalValues: [ - SceneOperationalValue( - icon: Assets.assetsSceneChildLock, - description: 'Lock', - value: true, - ), - SceneOperationalValue( - icon: Assets.assetsSceneChildUnlock, - description: 'Unlock', - value: false, - ), - ], - )); + functions.add( + childLockBasedOnCodeMatch(deviceId, taskItem), + ); break; default: } return functions; } + + SceneStaticFunction childLockBasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: 'Smart AC Thermostat - Grey - Model A', + deviceIcon: Assets.assetsIconsAC, + icon: Assets.assetsChildLock, + operationName: 'Child Lock', + code: 'child_lock', + functionValue: taskItem.functionValue, + operationDialogType: OperationDialogType.onOff, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsSceneChildLock, + description: 'Lock', + value: true, + ), + SceneOperationalValue( + icon: Assets.assetsSceneChildUnlock, + description: 'Unlock', + value: false, + ), + ], + ); + } + + SceneStaticFunction levelBasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: 'Smart AC Thermostat - Grey - Model A', + deviceIcon: Assets.assetsIconsAC, + icon: Assets.assetsFanSpeed, + operationName: 'Fan Speed', + code: 'level', + functionValue: taskItem.functionValue, + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcFanLow, + description: ValueACRange.LOW.name, + value: FanSpeeds.low.name, + ), + SceneOperationalValue( + icon: Assets.assetsAcFanMiddle, + description: ValueACRange.MIDDLE.name, + value: FanSpeeds.middle.name, + ), + SceneOperationalValue( + icon: Assets.assetsAcFanHigh, + description: ValueACRange.HIGH.name, + value: FanSpeeds.high.name, + ), + SceneOperationalValue( + icon: Assets.assetsAcFanAuto, + description: ValueACRange.AUTO.name, + value: FanSpeeds.auto.name, + ), + ], + ); + } + + SceneStaticFunction modeBasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: 'Smart AC Thermostat - Grey - Model A', + deviceIcon: Assets.assetsIconsAC, + icon: Assets.assetsFreezing, + operationName: 'Mode', + code: 'mode', + functionValue: taskItem.functionValue, + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcCooling, + description: AcValuesEnums.Cooling.name, + value: TempModes.cold.name, + ), + SceneOperationalValue( + icon: Assets.assetsAcHeating, + description: AcValuesEnums.Heating.name, + value: TempModes.hot.name, + ), + SceneOperationalValue( + icon: Assets.assetsFanSpeed, + description: AcValuesEnums.Ventilation.name, + value: TempModes.wind.name, + ), + ], + ); + } + + SceneStaticFunction tempSetBasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: 'Smart AC Thermostat - Grey - Model A', + deviceIcon: Assets.assetsIconsAC, + icon: Assets.assetsTempreture, + operationName: 'Set Temperature', + code: 'temp_set', + functionValue: taskItem.functionValue != null + ? ((taskItem.functionValue / 10) as double).toInt() + : null, + operationDialogType: OperationDialogType.temperature, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsCelsiusDegrees, + value: 0, + description: 'COOL TO', + ), + ], + ); + } + + SceneStaticFunction switchBasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: 'Smart AC Thermostat - Grey - Model A', + deviceIcon: Assets.assetsIconsAC, + icon: Assets.assetsAcPower, + operationName: 'Power', + code: 'switch', + functionValue: taskItem.functionValue, + operationDialogType: OperationDialogType.onOff, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcPower, + description: "ON", + value: true, + ), + SceneOperationalValue( + icon: Assets.assetsAcPowerOFF, + description: "OFF", + value: false, + ), + ], + ); + } + + SceneStaticFunction countdown3BasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: '3 Gang Button Switch L-L', + deviceIcon: Assets.assetsIcons3GangSwitch, + icon: Assets.assetsLightCountdown, + operationName: 'Light 3 CountDown', + code: 'countdown_3', + functionValue: taskItem.functionValue, + operationDialogType: OperationDialogType.countdown, + operationalValues: [ + SceneOperationalValue(icon: '', value: 0), + ], + ); + } + + SceneStaticFunction countdown2BasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: '3 Gang Button Switch L-L', + deviceIcon: Assets.assetsIcons3GangSwitch, + icon: Assets.assetsLightCountdown, + operationName: 'Light 2 CountDown', + code: 'countdown_2', + functionValue: taskItem.functionValue, + operationDialogType: OperationDialogType.countdown, + operationalValues: [ + SceneOperationalValue(icon: '', value: 0), + ], + ); + } + + SceneStaticFunction countdown1BasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: '3 Gang Button Switch L-L', + deviceIcon: Assets.assetsIcons3GangSwitch, + icon: Assets.assetsLightCountdown, + operationName: 'Light 1 CountDown', + code: 'countdown_1', + functionValue: taskItem.functionValue, + operationDialogType: OperationDialogType.countdown, + operationalValues: [ + SceneOperationalValue(icon: '', value: 0), + ], + ); + } + + SceneStaticFunction switch3BasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: '3 Gang Button Switch L-L', + deviceIcon: Assets.assetsIcons3GangSwitch, + icon: Assets.assetsAcPower, + operationName: 'Light 3 Switch', + code: 'switch_3', + functionValue: taskItem.functionValue, + operationDialogType: OperationDialogType.onOff, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcPower, description: "ON", value: true), + SceneOperationalValue( + icon: Assets.assetsAcPowerOFF, description: "OFF", value: false), + ], + ); + } + + SceneStaticFunction switch2BasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: '3 Gang Button Switch L-L', + deviceIcon: Assets.assetsIcons3GangSwitch, + icon: Assets.assetsAcPower, + operationName: 'Light 2 Switch', + code: 'switch_2', + functionValue: taskItem.functionValue, + operationDialogType: OperationDialogType.onOff, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcPower, description: "ON", value: true), + SceneOperationalValue( + icon: Assets.assetsAcPowerOFF, description: "OFF", value: false), + ], + ); + } + + SceneStaticFunction switch1BasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: '3 Gang Button Switch L-L', + deviceIcon: Assets.assetsIcons3GangSwitch, + icon: Assets.assetsAcPower, + operationName: 'Light 1 Switch', + code: 'switch_1', + functionValue: taskItem.functionValue, + operationDialogType: OperationDialogType.onOff, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcPower, + description: "ON", + value: true, + ), + SceneOperationalValue( + icon: Assets.assetsAcPowerOFF, description: "OFF", value: false), + ], + ); + } + + SceneStaticFunction factoryResetBasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: 'Multi-Mode Gateway Z-W-B', + deviceIcon: Assets.assetsIconsGateway, + icon: Assets.assetsFactoryReset, + operationName: 'Reset Factory', + functionValue: taskItem.functionValue, + code: 'factory_reset', + operationDialogType: OperationDialogType.onOff, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsSceneRefresh, description: "ON", value: true), + SceneOperationalValue( + icon: Assets.assetsResetOff, + description: "OFF", + value: false, + ), + ], + ); + } + + SceneStaticFunction masterStateBasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: 'Multi-Mode Gateway Z-W-B', + deviceIcon: Assets.assetsIconsGateway, + icon: Assets.assetsMasterState, + operationName: 'Master State', + functionValue: taskItem.functionValue, + code: 'master_state', + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcPower, + description: "Alarm", + value: 'alarm', + ), + SceneOperationalValue( + icon: Assets.assetsAcPowerOFF, + description: "Normal", + value: 'normal', + ), + ], + ); + } + + SceneStaticFunction switchAlarmSoundBasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: 'Multi-Mode Gateway Z-W-B', + deviceIcon: Assets.assetsIconsGateway, + icon: Assets.assetsSwitchAlarmSound, + operationName: 'Switch Alarm Sound', + functionValue: taskItem.functionValue, + code: 'switch_alarm_sound', + operationDialogType: OperationDialogType.onOff, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcPower, + description: "ON", + value: true, + ), + SceneOperationalValue( + icon: Assets.assetsAcPowerOFF, description: "OFF", value: false), + ], + ); + } + + SceneStaticFunction presenceTimeBasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: 'Human Presence Sensor', + deviceIcon: Assets.assetsIconsSensors, + icon: Assets.assetsNobodyTime, + operationName: 'Nobody Time', + functionValue: taskItem.functionValue, + code: 'presence_time', + operationDialogType: OperationDialogType.temperature, + operationalValues: [ + SceneOperationalValue(icon: '', value: 0), + ], + ); + } + + SceneStaticFunction indicatorBasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: 'Human Presence Sensor', + deviceIcon: Assets.assetsIconsSensors, + icon: Assets.assetsIndicator, + operationName: 'Indicator', + functionValue: taskItem.functionValue, + code: 'indicator', + operationDialogType: OperationDialogType.onOff, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcPower, description: "ON", value: true), + SceneOperationalValue( + icon: Assets.assetsAcPowerOFF, + description: "OFF", + value: false, + ), + ], + ); + } + + SceneStaticFunction motionlessSensitivityBasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: 'Human Presence Sensor', + deviceIcon: Assets.assetsIconsSensors, + icon: Assets.assetsMotionlessDetection, + operationName: 'Motionless Detection Sensitivity', + functionValue: taskItem.functionValue, + code: 'motion_sensitivity_value', + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + iconValue: '1', + icon: Assets.assetsFarDetectionFunction, + value: 1, + description: '1', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 2, + description: '2', + iconValue: '2', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 3, + description: '3', + iconValue: '3', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 4, + description: '4', + iconValue: '4', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 5, + description: '5', + iconValue: '5', + ), + ], + ); + } + + SceneStaticFunction motionSensitivityValueBasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: 'Human Presence Sensor', + deviceIcon: Assets.assetsIconsSensors, + icon: Assets.assetsMotionDetection, + operationName: 'Motion Detection Sensitivity', + functionValue: taskItem.functionValue, + code: 'motion_sensitivity_value', + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 1, + description: 1.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 2, + description: 2.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 3, + description: 3.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 4, + description: 4.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 5, + description: 5.toString(), + ), + ], + ); + } + + SceneStaticFunction farDetectionBasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: 'Human Presence Sensor', + deviceIcon: Assets.assetsIconsSensors, + icon: Assets.assetsFarDetection, + operationName: 'Far Detection', + functionValue: taskItem.functionValue, + code: 'far_detection', + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 75, + description: '75cm', + iconValue: '75', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 150, + description: '150cm', + iconValue: '150', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 225, + description: '225cm', + iconValue: '225', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 300, + description: '300cm', + iconValue: '300', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 375, + description: '375cm', + iconValue: '375', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 450, + description: '450cm', + iconValue: '450', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 525, + description: '525cm', + iconValue: '525', + ), + SceneOperationalValue( + icon: Assets.assetsFarDetectionFunction, + value: 600, + description: '600cm', + iconValue: '600', + ), + ], + ); + } + + SceneStaticFunction normalOpenSwitchBasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: 'WIFI LOCK PRO', + deviceIcon: Assets.assetsIconsDoorLock, + icon: Assets.assetsIconsDoorLock, + operationName: 'Set Door lock Normal Open', + functionValue: taskItem.functionValue, + code: 'normal_open_switch', + operationDialogType: OperationDialogType.onOff, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsAcPower, description: "ON", value: true), + SceneOperationalValue( + icon: Assets.assetsAcPowerOFF, + description: "OFF", + value: false, + ), + ], + ); + } + + SceneStaticFunction sensitivityFunctionsBasedOnCodeMatch( + String deviceId, SceneStaticFunction taskItem) { + return SceneStaticFunction( + deviceId: deviceId, + deviceName: 'Presence Sensor', + deviceIcon: Assets.assetsIconsSensors, + icon: Assets.assetsSensitivityFunction, + operationName: 'Sensitivity', + code: 'sensitivity', + functionValue: taskItem.functionValue, + operationDialogType: OperationDialogType.listOfOptions, + operationalValues: [ + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 1, + description: 1.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 2, + description: 2.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 3, + description: 3.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 4, + description: 4.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 5, + description: 5.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 6, + description: 6.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 7, + description: 7.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 8, + description: 8.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 9, + description: 9.toString(), + ), + SceneOperationalValue( + icon: Assets.assetsSensitivityOperationIcon, + value: 10, + description: 10.toString(), + ), + ], + ); + } } diff --git a/lib/features/scene/view/create_scene_view.dart b/lib/features/scene/view/create_scene_view.dart index 11e2ff0..f89e512 100644 --- a/lib/features/scene/view/create_scene_view.dart +++ b/lib/features/scene/view/create_scene_view.dart @@ -68,6 +68,7 @@ class CreateSceneView extends StatelessWidget { sceneName: '', ), ); + context.read().add(const ClearTaskListEvent()); }, ), ], diff --git a/lib/features/scene/view/device_functions_view.dart b/lib/features/scene/view/device_functions_view.dart index 45daa3c..a6ef3b1 100644 --- a/lib/features/scene/view/device_functions_view.dart +++ b/lib/features/scene/view/device_functions_view.dart @@ -3,13 +3,9 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_app/features/devices/model/device_control_model.dart'; import 'package:syncrow_app/features/devices/model/device_model.dart'; import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.dart'; -import 'package:syncrow_app/features/scene/enum/operation_dialog_type.dart'; import 'package:syncrow_app/features/scene/helper/scene_logic_helper.dart'; import 'package:syncrow_app/features/scene/helper/scene_operations_data_helper.dart'; import 'package:syncrow_app/features/scene/model/scene_static_function.dart'; -import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_countdown.dart'; -import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_functions_body.dart'; -import 'package:syncrow_app/features/scene/widgets/alert_dialogs/alert_dialog_temperature_body.dart'; import 'package:syncrow_app/features/scene/widgets/scene_list_tile.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; @@ -139,28 +135,10 @@ class DeviceFunctionsView extends StatelessWidget .selectedValues[functions[index].code]; context.customAlertDialog( - alertBody: functions[index].operationDialogType == - OperationDialogType.temperature - ? AlertDialogTemperatureBody( - taskItem: functions[index], - functionValue: functionValues, - ) - : ((functions[index].operationDialogType == - OperationDialogType.countdown) || - (functions[index].operationDialogType == - OperationDialogType.countdown)) - ? AlertDialogCountdown( - durationValue: functions[index] - .operationalValues - .first - .value, - function: functions[index], - functionValue: functionValues, - ) - : AlertDialogFunctionsOperationsBody( - taskItem: functions[index], - functionValue: functionValues, - ), + alertBody: getTheCorrectDialogBody( + functions[index], + functionValues, + ), title: functions[index].operationName, onConfirm: () { final selectedValue = context diff --git a/lib/features/scene/widgets/if_then_containers/if_container.dart b/lib/features/scene/widgets/if_then_containers/if_container.dart index 104b255..f2bceff 100644 --- a/lib/features/scene/widgets/if_then_containers/if_container.dart +++ b/lib/features/scene/widgets/if_then_containers/if_container.dart @@ -1,13 +1,17 @@ import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.dart'; +import 'package:syncrow_app/features/scene/enum/create_scene_enum.dart'; +import 'package:syncrow_app/features/scene/model/scene_settings_route_arguments.dart'; import 'package:syncrow_app/features/scene/widgets/scene_list_tile.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; import 'package:syncrow_app/features/shared_widgets/light_divider.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart'; import 'package:syncrow_app/generated/assets.dart'; +import 'package:syncrow_app/navigation/routing_constants.dart'; import 'package:syncrow_app/utils/context_extension.dart'; import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; -import 'package:syncrow_app/utils/resource_manager/strings_manager.dart'; class IFDefaultContainer extends StatelessWidget { const IFDefaultContainer({ @@ -29,19 +33,73 @@ class IFDefaultContainer extends StatelessWidget { color: ColorsManager.primaryTextColor, ), ), - trailingWidget: SvgPicture.asset(Assets.addIcon), + trailingWidget: GestureDetector( + onTap: () => Navigator.pushNamed( + context, + Routes.sceneControlDevicesRoute, + arguments: SceneSettingsRouteArguments( + sceneType: CreateSceneEnum.deviceStatusChanges.name, + sceneId: '', + sceneName: '', + ), + ), + child: SvgPicture.asset( + Assets.addIcon, + colorFilter: const ColorFilter.mode( + ColorsManager.primaryColor, + BlendMode.srcIn, + ), + ), + ), padding: EdgeInsets.zero, ), const LightDivider(), - const SceneListTile( - assetPath: Assets.handClickIcon, - titleString: StringsManager.tapToRun, - padding: EdgeInsets.zero, + BlocBuilder( + builder: (context, state) { + if (state is CreateSceneLoading) { + return const Center(child: LinearProgressIndicator()); + } + + // if (state is AddSceneTask) { + // final taskLists = state.tasksList; + // if (taskLists.isNotEmpty) { + // return ListView.builder( + // shrinkWrap: true, + // physics: const NeverScrollableScrollPhysics(), + // itemCount: taskLists.length, + // reverse: true, + // itemBuilder: (context, index) { + // return ThenAddedTasksContainer( + // taskItem: taskLists[index], + // ); + // }, + // ); + // } + // return SceneListTile( + // titleString: '+ Add Task', + // textAlign: TextAlign.center, + // onPressed: () => context.customBottomSheet( + // child: const CustomBottomSheetWidget(), + // ), + // ); + // } + return SceneListTile( + titleString: '+ Add Condition', + textAlign: TextAlign.center, + onPressed: () => Navigator.pushNamed( + context, + Routes.sceneControlDevicesRoute, + arguments: SceneSettingsRouteArguments( + sceneType: CreateSceneEnum.deviceStatusChanges.name, + sceneId: '', + sceneName: '', + ), + ), + ); + }, ) ], ), ); } } - - diff --git a/lib/features/scene/widgets/scene_devices/scene_devices_body.dart b/lib/features/scene/widgets/scene_devices/scene_devices_body.dart index 0c3b9ab..60e97c8 100644 --- a/lib/features/scene/widgets/scene_devices/scene_devices_body.dart +++ b/lib/features/scene/widgets/scene_devices/scene_devices_body.dart @@ -28,10 +28,11 @@ class SceneDevicesBody extends StatelessWidget { @override Widget build(BuildContext context) { - final isAutomationDeviceStatus = (ModalRoute.of(context)?.settings.arguments - as SceneSettingsRouteArguments) - .sceneType == - CreateSceneEnum.deviceStatusChanges.name; + final isAutomationDeviceStatus = ((ModalRoute.of(context) + ?.settings + .arguments as SceneSettingsRouteArguments?) + ?.sceneType == + CreateSceneEnum.deviceStatusChanges.name); return BlocBuilder( builder: (context, tabState) { return Column( diff --git a/lib/generated/assets.dart b/lib/generated/assets.dart index d6599ef..0b31f0e 100644 --- a/lib/generated/assets.dart +++ b/lib/generated/assets.dart @@ -1004,4 +1004,24 @@ class Assets { static const String assetsTempPasswordUnlock = "assets/icons/functions_icons/automation_functions/temp_password_unlock.svg"; + + //assets/icons/functions_icons/automation_functions/self_test_result.svg + + static const String assetsSelfTestResult = + "assets/icons/functions_icons/automation_functions/self_test_result.svg"; + + ///assets/icons/functions_icons/automation_functions/presence.svg + + static const String assetsPresence = + "assets/icons/functions_icons/automation_functions/presence.svg"; + + //assets/icons/functions_icons/automation_functions/motion.svg + + static const String assetsMotion = + "assets/icons/functions_icons/automation_functions/motion.svg"; + + //assets/icons/functions_icons/automation_functions/current_temp.svg + + static const String assetsCurrentTemp = + "assets/icons/functions_icons/automation_functions/current_temp.svg"; }