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 FourSceneEvent extends Equatable {
  const FourSceneEvent();

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

class FourSceneInitialInfo extends FourSceneEvent {
  const FourSceneInitialInfo();
}

class FourSceneInitial extends FourSceneEvent {
  const FourSceneInitial();
}

class SaveNameEvent extends FourSceneEvent {
  final String? deviceName;

  const SaveNameEvent({this.deviceName});
}

class ToggleEnableAlarmEvent extends FourSceneEvent {
  final bool isLowBatteryEnabled;

  const ToggleEnableAlarmEvent(this.isLowBatteryEnabled);

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

class ToggleNotificationEvent extends FourSceneEvent {
  final bool isClosingEnabled;

  const ToggleNotificationEvent(this.isClosingEnabled);

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

class DeleteDeviceEvent extends FourSceneEvent {}

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

class SearchFaqEvent extends FourSceneEvent {
  final String query;

  const SearchFaqEvent(this.query);
}

class FourSceneInitialQuestion extends FourSceneEvent {
  const FourSceneInitialQuestion();
}

class ChangeSwitchStatusEvent extends FourSceneEvent {}

class FetchRoomsEvent extends FourSceneEvent {
  final SpaceModel unit;

  const FetchRoomsEvent({required this.unit});

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

class LoadScenes extends FourSceneEvent {
  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 FourSceneEvent {
  final String selectedSceneId;
  final bool isSelected;
  // final String unitId;
  const SelectSceneEvent({
    // required this.unitId,
    required this.selectedSceneId,
    required this.isSelected,
  });
}

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

class SelectOptionEvent extends FourSceneEvent {
  final dynamic selectedOption;
  const SelectOptionEvent({
    this.selectedOption,
  });
}

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

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

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

class AssignRoomEvent extends FourSceneEvent {
  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 FetchDeviceScene extends FourSceneEvent {}

class FourSceneSwitchInitial extends FourSceneEvent {
  const FourSceneSwitchInitial();
}

class UnAssignSceneEvent extends FourSceneEvent {
  final String deviceUuid;
  final String switchName;
  const UnAssignSceneEvent(
      {required this.deviceUuid, required this.switchName});
}

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

class GetSceneBySwitchName extends FourSceneEvent {
  final String? switchName;

  const GetSceneBySwitchName({this.switchName});
}

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

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