import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/app_layout/model/space_model.dart';
import 'package:syncrow_app/features/devices/model/group_devices_model.dart';

abstract class SixSceneEvent extends Equatable {
  const SixSceneEvent();

  @override
  List<Object> get props => [];
}

class GetSceneBySwitchName extends SixSceneEvent {
  final String? switchName;

  const GetSceneBySwitchName({this.switchName});
}

class SixSceneInitial extends SixSceneEvent {
  const SixSceneInitial();
}

class SaveNameEvent extends SixSceneEvent {
  const SaveNameEvent();
}

class UnAssignSceneEvent extends SixSceneEvent {
  final String switchSceneUuid;
  const UnAssignSceneEvent({required this.switchSceneUuid});
}

class SixSceneInitialInfo extends SixSceneEvent {
  const SixSceneInitialInfo();
}

class SexSceneSwitchInitial extends SixSceneEvent {
  const SexSceneSwitchInitial();
}

class ToggleEnableAlarmEvent extends SixSceneEvent {
  final bool isLowBatteryEnabled;

  const ToggleEnableAlarmEvent(this.isLowBatteryEnabled);

  @override
  List<Object> get props => [isLowBatteryEnabled];
}

class ToggleNotificationEvent extends SixSceneEvent {
  final bool isClosingEnabled;

  const ToggleNotificationEvent(this.isClosingEnabled);

  @override
  List<Object> get props => [isClosingEnabled];
}

class DeleteDeviceEvent extends SixSceneEvent {}

class ChangeNameEvent extends SixSceneEvent {
  final bool? value;
  const ChangeNameEvent({this.value});
}

class SearchFaqEvent extends SixSceneEvent {
  final String query;

  const SearchFaqEvent(this.query);
}

class SixSceneInitialQuestion extends SixSceneEvent {
  const SixSceneInitialQuestion();
}

class ChangeSwitchStatusEvent extends SixSceneEvent {}

class FetchRoomsEvent extends SixSceneEvent {
  final SpaceModel unit;

  const FetchRoomsEvent({required this.unit});

  @override
  List<Object> get props => [unit];
}

class LoadScenes extends SixSceneEvent {
  final String unitId;
  final bool showInDevice;
  final SpaceModel unit;

  const LoadScenes(
      {required this.unitId, required this.unit, this.showInDevice = false});

  @override
  List<Object> get props => [unitId, showInDevice];
}

class SelectSceneEvent extends SixSceneEvent {
  final String selectedSceneId;
  final bool isSelected;
  // final String unitId;
  const SelectSceneEvent({
    // required this.unitId,
    required this.selectedSceneId,
    required this.isSelected,
  });
}


class SearchScenesEvent extends SixSceneEvent {
  final String query;
  const SearchScenesEvent({
    required this.query,
  });
}

class SaveSelectionEvent extends SixSceneEvent {}

class SelectOptionEvent extends SixSceneEvent {
  dynamic selectedOption;
  SelectOptionEvent({
    this.selectedOption,
  });
}

class AddDeviceToGroup extends SixSceneEvent {
  final GroupDevicesModel device;
  final String icon;
  const AddDeviceToGroup(this.device, this.icon);
}

class RemoveDeviceFromGroup extends SixSceneEvent {
  final GroupDevicesModel device;
  final String icon;

  const RemoveDeviceFromGroup(this.device, this.icon);
}

class AssignDeviceScene extends SixSceneEvent {
  final String? sceneUuid;
  final String? switchName;
  final SpaceModel? unit;
  const AssignDeviceScene({
    this.sceneUuid,
    this.unit,
    this.switchName,
  });
}

class AssignRoomEvent extends SixSceneEvent {
  final String roomId;
  final SpaceModel unit;
  final BuildContext context;

  const AssignRoomEvent({
    required this.roomId,
    required this.unit,
    required this.context,
  });

  @override
  List<Object> get props => [
        roomId,
        unit,
        context,
      ];
}

class ToggleUpdateEvent extends SixSceneEvent {
  final bool? isUpdateEnabled;
  const ToggleUpdateEvent({this.isUpdateEnabled});
}

class ToggleHelpfulEvent extends SixSceneEvent {
  final bool? isHelpful;
  const ToggleHelpfulEvent({this.isHelpful});
}
