mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 17:47:28 +00:00
215 lines
4.8 KiB
Dart
215 lines
4.8 KiB
Dart
part of 'create_scene_bloc.dart';
|
|
|
|
sealed class CreateSceneEvent extends Equatable {
|
|
const CreateSceneEvent();
|
|
|
|
@override
|
|
List<Object> get props => [];
|
|
}
|
|
|
|
class AddTaskEvent extends CreateSceneEvent {
|
|
const AddTaskEvent({this.isAutomation});
|
|
final bool? isAutomation;
|
|
|
|
@override
|
|
List<Object> get props => [];
|
|
}
|
|
|
|
class TempHoldSceneTasksEvent extends CreateSceneEvent {
|
|
final DeviceControlModel deviceControlModel;
|
|
final String deviceId;
|
|
final String icon;
|
|
final String operation;
|
|
final String deviceName;
|
|
final String uniqueId;
|
|
final bool? isAutomation;
|
|
final OperationDialogType operationType;
|
|
|
|
const TempHoldSceneTasksEvent({
|
|
required this.deviceControlModel,
|
|
required this.deviceId,
|
|
required this.icon,
|
|
required this.operation,
|
|
required this.deviceName,
|
|
required this.uniqueId,
|
|
this.isAutomation,
|
|
required this.operationType,
|
|
});
|
|
|
|
@override
|
|
List<Object> get props => [
|
|
deviceControlModel,
|
|
deviceId,
|
|
deviceName,
|
|
icon,
|
|
operation,
|
|
uniqueId,
|
|
deviceName,
|
|
icon,
|
|
];
|
|
}
|
|
|
|
class UpdateTaskEvent extends CreateSceneEvent {
|
|
final String taskId;
|
|
final dynamic newValue;
|
|
final bool? isAutomation;
|
|
const UpdateTaskEvent({
|
|
required this.taskId,
|
|
required this.newValue,
|
|
this.isAutomation,
|
|
});
|
|
@override
|
|
List<Object> get props => [taskId, newValue];
|
|
}
|
|
|
|
class SelectedValueEvent extends CreateSceneEvent {
|
|
final dynamic value;
|
|
final dynamic automationValue;
|
|
final String code;
|
|
final bool? isAutomation;
|
|
final String? comparator;
|
|
|
|
const SelectedValueEvent({
|
|
this.value,
|
|
required this.code,
|
|
this.isAutomation,
|
|
this.automationValue,
|
|
this.comparator,
|
|
});
|
|
|
|
@override
|
|
List<Object> get props => [value!, code];
|
|
}
|
|
|
|
class RemoveTaskByIdEvent extends CreateSceneEvent {
|
|
final String taskId;
|
|
final bool? isAutomation;
|
|
const RemoveTaskByIdEvent({
|
|
required this.taskId,
|
|
this.isAutomation,
|
|
});
|
|
|
|
@override
|
|
List<Object> get props => [taskId];
|
|
}
|
|
|
|
class RemoveTempTaskByIdEvent extends CreateSceneEvent {
|
|
final String code;
|
|
final bool? isAutomation;
|
|
const RemoveTempTaskByIdEvent({required this.code, this.isAutomation});
|
|
|
|
@override
|
|
List<Object> get props => [code];
|
|
}
|
|
|
|
class RemoveFromSelectedValueById extends CreateSceneEvent {
|
|
final String code;
|
|
final bool? isAutomation;
|
|
const RemoveFromSelectedValueById({required this.code, this.isAutomation});
|
|
|
|
@override
|
|
List<Object> get props => [code];
|
|
}
|
|
|
|
class CreateSceneWithTasksEvent extends CreateSceneEvent {
|
|
final CreateSceneModel? createSceneModel;
|
|
final bool updateScene;
|
|
final String sceneId;
|
|
final CreateAutomationModel? createAutomationModel;
|
|
//final bool isAutomation;
|
|
const CreateSceneWithTasksEvent({
|
|
required this.createSceneModel,
|
|
required this.updateScene,
|
|
required this.sceneId,
|
|
required this.createAutomationModel,
|
|
// required this.isAutomation,
|
|
});
|
|
|
|
@override
|
|
List<Object> get props => [];
|
|
}
|
|
|
|
class ClearTaskListEvent extends CreateSceneEvent {
|
|
const ClearTaskListEvent({this.isAutomation});
|
|
final bool? isAutomation;
|
|
|
|
@override
|
|
List<Object> get props => [];
|
|
}
|
|
|
|
class ClearTempTaskListEvent extends CreateSceneEvent {
|
|
const ClearTempTaskListEvent({this.isAutomation});
|
|
final bool? isAutomation;
|
|
|
|
@override
|
|
List<Object> get props => [];
|
|
}
|
|
|
|
class FetchSceneTasksEvent extends CreateSceneEvent {
|
|
final String sceneId;
|
|
final bool isAutomation;
|
|
|
|
const FetchSceneTasksEvent({this.isAutomation = false, required this.sceneId});
|
|
|
|
@override
|
|
List<Object> get props => [sceneId, isAutomation];
|
|
}
|
|
|
|
class DeleteSceneEvent extends CreateSceneEvent {
|
|
final String sceneId;
|
|
final String unitUuid;
|
|
const DeleteSceneEvent({
|
|
required this.sceneId,
|
|
required this.unitUuid,
|
|
});
|
|
|
|
@override
|
|
List<Object> get props => [sceneId, unitUuid];
|
|
}
|
|
|
|
class SelectConditionEvent extends CreateSceneEvent {
|
|
final String condition;
|
|
|
|
const SelectConditionEvent(this.condition);
|
|
}
|
|
|
|
class SceneTypeEvent extends CreateSceneEvent {
|
|
final CreateSceneEnum type;
|
|
const SceneTypeEvent(this.type);
|
|
}
|
|
|
|
class EffectiveTimePeriodEvent extends CreateSceneEvent {
|
|
final EffectiveTime period;
|
|
const EffectiveTimePeriodEvent(this.period);
|
|
}
|
|
|
|
class SceneIconEvent extends CreateSceneEvent {}
|
|
|
|
class IconSelected extends CreateSceneEvent {
|
|
final String iconId;
|
|
final bool confirmSelection;
|
|
|
|
const IconSelected({required this.iconId, required this.confirmSelection});
|
|
|
|
@override
|
|
List<Object> get props => [iconId];
|
|
}
|
|
|
|
class ShowOnDeviceClicked extends CreateSceneEvent {
|
|
final bool value;
|
|
|
|
const ShowOnDeviceClicked({
|
|
required this.value,
|
|
});
|
|
|
|
@override
|
|
List<Object> get props => [value];
|
|
}
|
|
|
|
class ClearTabToRunSetting extends CreateSceneEvent {
|
|
const ClearTabToRunSetting();
|
|
|
|
@override
|
|
List<Object> get props => [];
|
|
}
|