mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-14 09:17:23 +00:00
Refactor device name display in RoomPageSwitch widget
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(
|
||||
productType: condition.productType,
|
||||
actionExecutor: 'device_report',
|
||||
entityId: condition.entityId,
|
||||
executorProperty: ExecutorProperty(
|
||||
@ -833,6 +834,7 @@ mixin SceneOperationsDataHelper {
|
||||
|
||||
SceneStaticFunction _createSwitch1Function(Action action, bool isAutomation,
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
print('action.productType1=${action.productType}');
|
||||
switch (action.productType) {
|
||||
case "3G":
|
||||
return _createSceneFunction(
|
||||
@ -858,12 +860,24 @@ mixin SceneOperationsDataHelper {
|
||||
comparator,
|
||||
uniqueCustomId,
|
||||
);
|
||||
default:
|
||||
case "1G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'1 Gang Button Switch L-L',
|
||||
Assets.oneGang,
|
||||
'Light Switch',
|
||||
'Light 1 Switch',
|
||||
OperationDialogType.onOff,
|
||||
_createOnOffOptions(),
|
||||
isAutomation,
|
||||
comparator,
|
||||
uniqueCustomId,
|
||||
);
|
||||
default:
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'None',
|
||||
Assets.assetsRemoteUnlockReq,
|
||||
'None',
|
||||
OperationDialogType.onOff,
|
||||
_createOnOffOptions(),
|
||||
isAutomation,
|
||||
@ -1434,6 +1448,7 @@ mixin SceneOperationsDataHelper {
|
||||
return [
|
||||
_mapExecutorPropertyToSceneFunction(
|
||||
Action(
|
||||
productType: '',
|
||||
entityId: deviceId,
|
||||
executorProperty: ExecutorProperty(
|
||||
functionCode: taskItem.code,
|
||||
|
Reference in New Issue
Block a user