mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-26 22:04:54 +00:00
push switch autoaomtion status update
This commit is contained in:
@ -66,36 +66,40 @@ mixin SceneLogicHelper {
|
||||
);
|
||||
},
|
||||
),
|
||||
actions: List.generate(
|
||||
actions.length,
|
||||
(index) {
|
||||
final task = actions[index];
|
||||
if (task.deviceId == 'delay') {
|
||||
actions: [
|
||||
...List.generate(
|
||||
actions.length,
|
||||
(index) {
|
||||
final task = actions[index];
|
||||
if (task.deviceId == 'delay') {
|
||||
return CreateSceneAction(
|
||||
entityId: actions[index].deviceId,
|
||||
actionExecutor: 'delay',
|
||||
executorProperty: CreateSceneExecutorProperty(
|
||||
functionCode: '',
|
||||
functionValue: '',
|
||||
delaySeconds: task.functionValue,
|
||||
),
|
||||
);
|
||||
}
|
||||
return CreateSceneAction(
|
||||
entityId: actions[index].deviceId,
|
||||
actionExecutor: 'delay',
|
||||
entityId: task.deviceId,
|
||||
actionExecutor: 'device_issue',
|
||||
executorProperty: CreateSceneExecutorProperty(
|
||||
functionCode: '',
|
||||
functionValue: '',
|
||||
delaySeconds: task.functionValue,
|
||||
functionCode: task.code,
|
||||
functionValue: task.functionValue,
|
||||
delaySeconds: 0,
|
||||
),
|
||||
);
|
||||
}
|
||||
return CreateSceneAction(
|
||||
entityId: task.deviceId,
|
||||
actionExecutor: 'device_issue',
|
||||
executorProperty: CreateSceneExecutorProperty(
|
||||
functionCode: task.code,
|
||||
functionValue: task.functionValue,
|
||||
delaySeconds: 0,
|
||||
),
|
||||
);
|
||||
},
|
||||
)..add(CreateSceneAction(
|
||||
entityId: smartSceneBloc.smartSceneEnable?.entityId ?? '',
|
||||
actionExecutor:
|
||||
smartSceneBloc.smartSceneEnable?.actionExecutor ?? '',
|
||||
executorProperty: null)),
|
||||
},
|
||||
),
|
||||
if (smartSceneBloc.smartSceneEnable != null)
|
||||
CreateSceneAction(
|
||||
entityId: smartSceneBloc.smartSceneEnable?.entityId ?? '',
|
||||
actionExecutor:
|
||||
smartSceneBloc.smartSceneEnable?.actionExecutor ?? '',
|
||||
executorProperty: null)
|
||||
],
|
||||
);
|
||||
sceneBloc.add(CreateSceneWithTasksEvent(
|
||||
createSceneModel: null,
|
||||
@ -121,36 +125,40 @@ mixin SceneLogicHelper {
|
||||
unitUuid: HomeCubit.getInstance().selectedSpace!.id ?? '',
|
||||
sceneName: sceneName.text,
|
||||
decisionExpr: 'and',
|
||||
actions: List.generate(
|
||||
actions.length,
|
||||
(index) {
|
||||
final task = actions[index];
|
||||
if (task.deviceId == 'delay') {
|
||||
actions: [
|
||||
...List.generate(
|
||||
actions.length,
|
||||
(index) {
|
||||
final task = actions[index];
|
||||
if (task.deviceId == 'delay') {
|
||||
return CreateSceneAction(
|
||||
entityId: actions[index].deviceId,
|
||||
actionExecutor: 'delay',
|
||||
executorProperty: CreateSceneExecutorProperty(
|
||||
functionCode: '',
|
||||
functionValue: '',
|
||||
delaySeconds: task.functionValue,
|
||||
),
|
||||
);
|
||||
}
|
||||
return CreateSceneAction(
|
||||
entityId: actions[index].deviceId,
|
||||
actionExecutor: 'delay',
|
||||
entityId: task.deviceId,
|
||||
actionExecutor: 'device_issue',
|
||||
executorProperty: CreateSceneExecutorProperty(
|
||||
functionCode: '',
|
||||
functionValue: '',
|
||||
delaySeconds: task.functionValue,
|
||||
functionCode: task.code,
|
||||
functionValue: task.functionValue,
|
||||
delaySeconds: 0,
|
||||
),
|
||||
);
|
||||
}
|
||||
return CreateSceneAction(
|
||||
entityId: task.deviceId,
|
||||
actionExecutor: 'device_issue',
|
||||
executorProperty: CreateSceneExecutorProperty(
|
||||
functionCode: task.code,
|
||||
functionValue: task.functionValue,
|
||||
delaySeconds: 0,
|
||||
),
|
||||
);
|
||||
},
|
||||
)..add(CreateSceneAction(
|
||||
entityId: smartSceneBloc.smartSceneEnable?.entityId ?? '',
|
||||
actionExecutor:
|
||||
smartSceneBloc.smartSceneEnable?.actionExecutor ?? '',
|
||||
executorProperty: null)),
|
||||
},
|
||||
),
|
||||
if (smartSceneBloc.smartSceneEnable != null)
|
||||
CreateSceneAction(
|
||||
entityId: smartSceneBloc.smartSceneEnable?.entityId ?? '',
|
||||
actionExecutor:
|
||||
smartSceneBloc.smartSceneEnable?.actionExecutor ?? '',
|
||||
executorProperty: null)
|
||||
],
|
||||
);
|
||||
sceneBloc.add(CreateSceneWithTasksEvent(
|
||||
createSceneModel: createSceneModel,
|
||||
|
||||
Reference in New Issue
Block a user