mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
Refactor device name display in Action and Condition models
This commit is contained in:
@ -259,6 +259,7 @@ mixin SceneOperationsDataHelper {
|
||||
for (var condition in conditions) {
|
||||
// Create a dummy Action from Condition to reuse _mapExecutorPropertyToSceneFunction
|
||||
Action dummyAction = Action(
|
||||
deviceName: condition.deviceName,
|
||||
productType: condition.productType,
|
||||
actionExecutor: 'device_report',
|
||||
entityId: condition.entityId,
|
||||
@ -369,7 +370,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Sensitivity',
|
||||
isAutomation
|
||||
@ -386,7 +387,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Set Door lock Normal Open',
|
||||
OperationDialogType.onOff,
|
||||
@ -440,7 +441,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Fingerprint Unlock',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -455,7 +456,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Password Unlock',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -470,7 +471,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Card Unlock',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -485,7 +486,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Lock Alarm',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -500,7 +501,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Remote Unlock Request',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -515,7 +516,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Residual Electricity',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -530,7 +531,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Double Lock',
|
||||
OperationDialogType.onOff,
|
||||
@ -545,7 +546,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Remote Unlock Via App',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -560,7 +561,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Hijack Alarm',
|
||||
OperationDialogType.onOff,
|
||||
@ -575,7 +576,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Doorbell',
|
||||
OperationDialogType.onOff,
|
||||
@ -590,7 +591,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Temporary Password Unlock',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -605,7 +606,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Far Detection',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -620,7 +621,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Motion Detection Sensitivity',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -635,7 +636,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Motionless Detection Sensitivity',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -650,7 +651,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Indicator',
|
||||
OperationDialogType.onOff,
|
||||
@ -665,7 +666,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Nobody Time',
|
||||
OperationDialogType.countdown,
|
||||
@ -680,7 +681,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Presence State',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -695,7 +696,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Current Distance',
|
||||
isAutomation
|
||||
@ -712,7 +713,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Illuminance Value',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -727,7 +728,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Self-Test Result',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -742,7 +743,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsAC,
|
||||
'Power',
|
||||
OperationDialogType.onOff,
|
||||
@ -757,7 +758,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsAC,
|
||||
'Set Temperature',
|
||||
isAutomation
|
||||
@ -776,7 +777,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsAC,
|
||||
'Current Temperature',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -791,7 +792,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsAC,
|
||||
'Mode',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -806,7 +807,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsAC,
|
||||
'Fan Speed',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -821,7 +822,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsAC,
|
||||
'Child Lock',
|
||||
OperationDialogType.onOff,
|
||||
@ -838,7 +839,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "3G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.assetsIcons3GangSwitch,
|
||||
'Light 1 Switch',
|
||||
OperationDialogType.onOff,
|
||||
@ -850,7 +851,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "2G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'2 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.twoGang,
|
||||
'Light 1 Switch',
|
||||
OperationDialogType.onOff,
|
||||
@ -862,7 +863,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "1G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'1 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.oneGang,
|
||||
'Light 1 Switch',
|
||||
OperationDialogType.onOff,
|
||||
@ -892,7 +893,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "3G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.assetsIcons3GangSwitch,
|
||||
'Light 2 Switch',
|
||||
OperationDialogType.onOff,
|
||||
@ -904,7 +905,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "2G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'2 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.twoGang,
|
||||
'Light 2 Switch',
|
||||
OperationDialogType.onOff,
|
||||
@ -916,7 +917,7 @@ mixin SceneOperationsDataHelper {
|
||||
default:
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'1 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.oneGang,
|
||||
'Light Switch',
|
||||
OperationDialogType.onOff,
|
||||
@ -932,7 +933,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.assetsIcons3GangSwitch,
|
||||
'Light 3 Switch',
|
||||
OperationDialogType.onOff,
|
||||
@ -949,7 +950,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "3G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.assetsIcons3GangSwitch,
|
||||
'Light 1 CountDown',
|
||||
isAutomation
|
||||
@ -965,7 +966,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "2G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'2 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.twoGang,
|
||||
'Light 1 CountDown',
|
||||
isAutomation
|
||||
@ -981,7 +982,7 @@ mixin SceneOperationsDataHelper {
|
||||
default:
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'1 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.oneGang,
|
||||
'Light CountDown',
|
||||
isAutomation
|
||||
@ -1003,7 +1004,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "3G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.assetsIcons3GangSwitch,
|
||||
'Light 2 CountDown',
|
||||
isAutomation
|
||||
@ -1019,7 +1020,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "2G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'2 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.twoGang,
|
||||
'Light 2 CountDown',
|
||||
isAutomation
|
||||
@ -1035,7 +1036,7 @@ mixin SceneOperationsDataHelper {
|
||||
default:
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'1 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.oneGang,
|
||||
'Light CountDown',
|
||||
isAutomation
|
||||
@ -1055,7 +1056,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.assetsIcons3GangSwitch,
|
||||
'Light 3 CountDown',
|
||||
isAutomation
|
||||
@ -1074,7 +1075,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Gateway',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsGateway,
|
||||
'Switch Alarm Sound',
|
||||
OperationDialogType.onOff,
|
||||
@ -1089,7 +1090,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Gateway',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsGateway,
|
||||
'Master State',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -1104,7 +1105,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Gateway',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsGateway,
|
||||
'Factory Reset',
|
||||
OperationDialogType.onOff,
|
||||
@ -1447,6 +1448,7 @@ mixin SceneOperationsDataHelper {
|
||||
return [
|
||||
_mapExecutorPropertyToSceneFunction(
|
||||
Action(
|
||||
deviceName: taskItem.deviceName,
|
||||
productType: '',
|
||||
entityId: deviceId,
|
||||
executorProperty: ExecutorProperty(
|
||||
|
Reference in New Issue
Block a user