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

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

class DeviceSettingInitialInfo extends DeviceSettingEvent {
  const DeviceSettingInitialInfo();
}

class DeviceSettingInitial extends DeviceSettingEvent {
  const DeviceSettingInitial();
}

class SaveNameEvent extends DeviceSettingEvent {
  final String? deviceName;

  const SaveNameEvent({this.deviceName});
}

class ToggleEnableAlarmEvent extends DeviceSettingEvent {
  final bool isLowBatteryEnabled;

  const ToggleEnableAlarmEvent(this.isLowBatteryEnabled);

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

class ToggleNotificationEvent extends DeviceSettingEvent {
  final bool isClosingEnabled;

  const ToggleNotificationEvent(this.isClosingEnabled);

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

class DeleteDeviceEvent extends DeviceSettingEvent {}

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

class SearchFaqEvent extends DeviceSettingEvent {
  final String query;

  const SearchFaqEvent(this.query);
}

class DeviceSettingInitialQuestion extends DeviceSettingEvent {
  const DeviceSettingInitialQuestion();
}

// class ChangeSwitchStatusEvent extends DeviceSettingEvent {}

class FetchRoomsEvent extends DeviceSettingEvent {
  final SpaceModel unit;

  const FetchRoomsEvent({required this.unit});

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

class LoadSettings extends DeviceSettingEvent {
  final String unitId;
  final bool showInDevice;
  final SpaceModel unit;

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

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

class SelectSettingEvent extends DeviceSettingEvent {
  final String selectedSettingId;
  // final String unitId;
  const SelectSettingEvent({
    // required this.unitId,
    required this.selectedSettingId,
  });
}

class SearchSettingsEvent extends DeviceSettingEvent {
  final String query;
  const SearchSettingsEvent({
    required this.query,
  });
}

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

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

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

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

class AssignRoomEvent extends DeviceSettingEvent {
  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 FetchDeviceSetting extends DeviceSettingEvent {}

// class DeviceSettingSwitchInitial extends DeviceSettingEvent {
//   const DeviceSettingSwitchInitial();
// }

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

class GetSettingBySwitchName extends DeviceSettingEvent {
  final String? switchName;

  const GetSettingBySwitchName({this.switchName});
}

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

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