import 'package:equatable/equatable.dart';

abstract class GarageDoorEvent extends Equatable {
  const GarageDoorEvent();

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

class GarageDoorLoading extends GarageDoorEvent {}

class GarageDoorSwitch extends GarageDoorEvent {
  final bool switchD;
  final String deviceId;
  final String productId;
  const GarageDoorSwitch(
      {required this.switchD, this.deviceId = '', this.productId = ''});

  @override
  List<Object> get props => [switchD, deviceId, productId];
}

class GarageDoorUpdated extends GarageDoorEvent {}

class GarageDoorInitial extends GarageDoorEvent {
  const GarageDoorInitial();
}

class ReportLogsInitial extends GarageDoorEvent {
  const ReportLogsInitial();
}

class GarageDoorChangeStatus extends GarageDoorEvent {}

class GetCounterEvent extends GarageDoorEvent {
  final String deviceCode;
  const GetCounterEvent({required this.deviceCode});
  @override
  List<Object> get props => [deviceCode];
}

class ToggleAlarmEvent extends GarageDoorEvent {
  final String isEnabled;

  const ToggleAlarmEvent(this.isEnabled);

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

class ToggleClosingReminderEvent extends GarageDoorEvent {
  final bool isClosingReminderEnabled;

  const ToggleClosingReminderEvent(this.isClosingReminderEnabled);

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

class ToggleDoorAlarmEvent extends GarageDoorEvent {
  final bool isDoorAlarmEnabled;

  const ToggleDoorAlarmEvent(this.isDoorAlarmEnabled);

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

class SetCounterValue extends GarageDoorEvent {
  final Duration duration;
  final String deviceCode;
  const SetCounterValue({required this.duration, required this.deviceCode});
  @override
  List<Object> get props => [duration, deviceCode];
}

class SetTimeOutValue extends GarageDoorEvent {
  final Duration duration;
  final String deviceCode;
  const SetTimeOutValue({required this.duration, required this.deviceCode});
  @override
  List<Object> get props => [duration, deviceCode];
}

class StartTimer extends GarageDoorEvent {
  final int duration;

  const StartTimer(this.duration);

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

class TickTimer extends GarageDoorEvent {
  final int remainingTime;

  const TickTimer({required this.remainingTime});

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

class StopTimer extends GarageDoorEvent {}

class OnClose extends GarageDoorEvent {}

//------------------- Schedule ----------=---------
class GetScheduleEvent extends GarageDoorEvent {}

class ScheduleSaveapp extends GarageDoorEvent {}

class UpdateStateEvent extends GarageDoorEvent {}

class ToggleScheduleEvent extends GarageDoorEvent {
  final String id;
  final bool toggle;
  const ToggleScheduleEvent({required this.toggle, required this.id});
  @override
  List<Object> get props => [toggle, id];
}

class ToggleDaySelectionEvent extends GarageDoorEvent {
  final String key;

  const ToggleDaySelectionEvent({required this.key});
  @override
  List<Object> get props => [key];
}

class DeleteScheduleEvent extends GarageDoorEvent {
  final String id;
  const DeleteScheduleEvent({required this.id});
  @override
  List<Object> get props => [id];
}

class ToggleSelectedEvent extends GarageDoorEvent {
  final int index;
  const ToggleSelectedEvent({required this.index});
  @override
  List<Object> get props => [index];
}

class ToggleCreateScheduleEvent extends GarageDoorEvent {
  final int index;
  const ToggleCreateScheduleEvent({required this.index});
  @override
  List<Object> get props => [index];
}

class ChangeFirstWizardSwitchStatusEvent extends GarageDoorEvent {
  final bool value;
  final String deviceId;
  const ChangeFirstWizardSwitchStatusEvent(
      {required this.value, this.deviceId = ''});
  @override
  List<Object> get props => [value, deviceId];
}

class SelectSecondsEvent extends GarageDoorEvent {
  final int seconds;
  const SelectSecondsEvent({required this.seconds});
  @override
  List<Object> get props => [seconds];
}

class ToggleDoorEvent extends GarageDoorEvent {
  final bool toggle;
  const ToggleDoorEvent({required this.toggle});
  @override
  List<Object> get props => [toggle];
}

class InitialWizardEvent extends GarageDoorEvent {}

class GroupAllOnEvent extends GarageDoorEvent {}

class GroupAllOffEvent extends GarageDoorEvent {}

class InitialEvent extends GarageDoorEvent {
  final bool groupScreen;
  const InitialEvent({required this.groupScreen});
  @override
  List<Object> get props => [groupScreen];
}
